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.
- mdsthin/MDSplus/__init__.py +68 -0
- mdsthin/__init__.py +29 -0
- mdsthin/connection.py +620 -0
- mdsthin/descriptors.py +2168 -0
- mdsthin/exceptions.py +1847 -0
- mdsthin/functions.py +1410 -0
- mdsthin/internals/CvtConvertFloat.py +237 -0
- mdsthin/internals/classdef.py +144 -0
- mdsthin/internals/dtypedef.py +311 -0
- mdsthin/internals/mdsdescrip.py +116 -0
- mdsthin/internals/opcbuiltins.py +952 -0
- mdsthin/mdstcl/__main__.py +40 -0
- mdsthin/message.py +121 -0
- mdsthin/tdic/__main__.py +40 -0
- mdsthin/test/__init__.py +32 -0
- mdsthin/test/__main__.py +61 -0
- mdsthin/test/cmod_test.py +74 -0
- mdsthin/test/connection_test.py +128 -0
- mdsthin/test/descriptors_test.py +599 -0
- mdsthin/test/exceptions_test.py +62 -0
- mdsthin/test/run.py +39 -0
- mdsthin/test/serialize_test.py +133 -0
- mdsthin-0.1.dist-info/LICENSE +8 -0
- mdsthin-0.1.dist-info/METADATA +18 -0
- mdsthin-0.1.dist-info/RECORD +27 -0
- mdsthin-0.1.dist-info/WHEEL +5 -0
- mdsthin-0.1.dist-info/top_level.txt +1 -0
|
@@ -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 *
|