mdsthin 0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,68 @@
1
+ #
2
+ # Copyright (c) 2024, Massachusetts Institute of Technology All rights reserved.
3
+ #
4
+ # Redistribution and use in source and binary forms, with or without
5
+ # modification, are permitted provided that the following conditions are met:
6
+ #
7
+ # Redistributions of source code must retain the above copyright notice, this
8
+ # list of conditions and the following disclaimer.
9
+ #
10
+ # Redistributions in binary form must reproduce the above copyright notice, this
11
+ # list of conditions and the following disclaimer in the documentation and/or
12
+ # other materials provided with the distribution.
13
+ #
14
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
18
+ # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
+ # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20
+ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22
+ # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
+ #
25
+
26
+ #
27
+ # This package provdes a "best effort" approach to adding compatability with the real MDSplus Python package
28
+ # Several classes are similar but with different names, others are missing entirely. So we map what we can,
29
+ # and can provide additional compatability mapping in the future
30
+ #
31
+
32
+ from ..connection import Connection, GetMany, PutMany
33
+
34
+ from ..descriptors import String, StringArray
35
+ from ..descriptors import Int8, Int16, Int32, Int64, Int8Array, Int16Array, Int32Array, Int64Array
36
+ from ..descriptors import List, Dictionary
37
+ from ..descriptors import Signal, Dimension, Window, Slope, Function, Conglom, Range, Action, Dispatch
38
+ from ..descriptors import Program, Routine, Procedure, Method, Dependency, Condition, WithUnits, Call, WithError
39
+ from ..functions import *
40
+
41
+ # Compatability
42
+
43
+ from ..descriptors import Descriptor as Data
44
+ from ..descriptors import Descriptor as DescriptorNULL
45
+ from ..descriptors import Descriptor as EmptyData
46
+
47
+ from ..descriptors import UInt8 as Uint8
48
+ from ..descriptors import UInt16 as Uint16
49
+ from ..descriptors import UInt32 as Uint32
50
+ from ..descriptors import UInt64 as Uint64
51
+
52
+ from ..descriptors import UInt8Array as Uint8Array
53
+ from ..descriptors import UInt16Array as Uint16Array
54
+ from ..descriptors import UInt32Array as Uint32Array
55
+ from ..descriptors import UInt64Array as Uint64Array
56
+
57
+ from .. import exceptions as mdsExceptions
58
+
59
+ mdsExceptions.statusToException = mdsExceptions.getException
60
+
61
+ def checkStatus(status, ignore=tuple(), message=None):
62
+ # TODO: message
63
+ if mdsExceptions.STATUS_NOT_OK(status):
64
+ exception = mdsExceptions.getException(status)
65
+ if isinstance(exception, ignore):
66
+ print(exception)
67
+ else:
68
+ raise exception
mdsthin/__init__.py ADDED
@@ -0,0 +1,29 @@
1
+ #
2
+ # Copyright (c) 2024, Massachusetts Institute of Technology All rights reserved.
3
+ #
4
+ # Redistribution and use in source and binary forms, with or without
5
+ # modification, are permitted provided that the following conditions are met:
6
+ #
7
+ # Redistributions of source code must retain the above copyright notice, this
8
+ # list of conditions and the following disclaimer.
9
+ #
10
+ # Redistributions in binary form must reproduce the above copyright notice, this
11
+ # list of conditions and the following disclaimer in the documentation and/or
12
+ # other materials provided with the distribution.
13
+ #
14
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
18
+ # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
+ # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20
+ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22
+ # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
+ #
25
+
26
+ from .connection import *
27
+ from .descriptors import *
28
+ from .exceptions import *
29
+ from .functions import *