nxswriter 3.14.0__py3-none-any.whl → 3.16.0__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.
- nxswriter/DecoderPool.py +20 -5
- nxswriter/Release.py +1 -1
- nxswriter/Types.py +14 -2
- {nxswriter-3.14.0.dist-info → nxswriter-3.16.0.dist-info}/METADATA +3 -2
- {nxswriter-3.14.0.dist-info → nxswriter-3.16.0.dist-info}/RECORD +9 -9
- {nxswriter-3.14.0.data → nxswriter-3.16.0.data}/scripts/NXSDataWriter +0 -0
- {nxswriter-3.14.0.data → nxswriter-3.16.0.data}/scripts/nxsfromxml +0 -0
- {nxswriter-3.14.0.dist-info → nxswriter-3.16.0.dist-info}/WHEEL +0 -0
- {nxswriter-3.14.0.dist-info → nxswriter-3.16.0.dist-info}/top_level.txt +0 -0
nxswriter/DecoderPool.py
CHANGED
|
@@ -175,8 +175,10 @@ class DATAARRAYdecoder(object):
|
|
|
175
175
|
self.__value = None
|
|
176
176
|
#: ([:obj:`str`, :obj:`str`]) header and image data
|
|
177
177
|
self.__data = None
|
|
178
|
-
#: (:obj:`str`) struct header format
|
|
179
|
-
self.
|
|
178
|
+
#: (:obj:`str`) struct header format ver < 4
|
|
179
|
+
self.__headerFormat123 = '<IHHIIHHHHHHHHIIIIIIII'
|
|
180
|
+
#: (:obj:`str`) struct header format ver >=4
|
|
181
|
+
self.__headerFormat = '<IHHIIHHHHHHHHIIIIIIQQII'
|
|
180
182
|
#: (:obj:`dict` <:obj:`str`, :obj:`any` > ) header data
|
|
181
183
|
self.__header = {}
|
|
182
184
|
#: (:obj:`dict` <:obj:`int`, :obj:`str` > ) format modes
|
|
@@ -200,7 +202,7 @@ class DATAARRAYdecoder(object):
|
|
|
200
202
|
"""
|
|
201
203
|
self.__data = data
|
|
202
204
|
self.format = data[0]
|
|
203
|
-
self._loadHeader(data[1]
|
|
205
|
+
self._loadHeader(data[1])
|
|
204
206
|
self.__value = None
|
|
205
207
|
|
|
206
208
|
def _loadHeader(self, headerData):
|
|
@@ -209,7 +211,15 @@ class DATAARRAYdecoder(object):
|
|
|
209
211
|
:param headerData: buffer with header data
|
|
210
212
|
:type headerData: :obj:`str`
|
|
211
213
|
"""
|
|
212
|
-
|
|
214
|
+
try:
|
|
215
|
+
hData = headerData[:struct.calcsize(self.__headerFormat)]
|
|
216
|
+
hdr = struct.unpack(self.__headerFormat, hData)
|
|
217
|
+
if hdr[1] < 4:
|
|
218
|
+
hData = headerData[:struct.calcsize(self.__headerFormat123)]
|
|
219
|
+
hdr = struct.unpack(self.__headerFormat123, hData)
|
|
220
|
+
except Exception:
|
|
221
|
+
hData = headerData[:struct.calcsize(self.__headerFormat123)]
|
|
222
|
+
hdr = struct.unpack(self.__headerFormat123, hData)
|
|
213
223
|
self.__header = {}
|
|
214
224
|
self.__header['magic'] = hdr[0]
|
|
215
225
|
self.__header['headerVersion'] = hdr[1]
|
|
@@ -261,7 +271,12 @@ class DATAARRAYdecoder(object):
|
|
|
261
271
|
if not self.__header or not self.__data:
|
|
262
272
|
return
|
|
263
273
|
if self.__value is None:
|
|
264
|
-
|
|
274
|
+
if 'headerVersion' in self.__header and \
|
|
275
|
+
self.__header['headerVersion'] >= 4:
|
|
276
|
+
image = self.__data[1][struct.calcsize(self.__headerFormat):]
|
|
277
|
+
else:
|
|
278
|
+
image = self.__data[1][
|
|
279
|
+
struct.calcsize(self.__headerFormat123):]
|
|
265
280
|
dformat = self.__formatID[self.__header['imageMode']]
|
|
266
281
|
fSize = struct.calcsize(dformat)
|
|
267
282
|
self.__value = numpy.array(
|
nxswriter/Release.py
CHANGED
nxswriter/Types.py
CHANGED
|
@@ -27,6 +27,18 @@ if sys.version_info > (3,):
|
|
|
27
27
|
long = int
|
|
28
28
|
|
|
29
29
|
|
|
30
|
+
try:
|
|
31
|
+
_npver = numpy.version.version.split(".")
|
|
32
|
+
NPMAJOR = int(_npver[0])
|
|
33
|
+
if NPMAJOR > 1:
|
|
34
|
+
npstring = numpy.bytes_
|
|
35
|
+
else:
|
|
36
|
+
npstring = numpy.string_
|
|
37
|
+
except Exception:
|
|
38
|
+
NPMAJOR = 1
|
|
39
|
+
npstring = numpy.string_
|
|
40
|
+
|
|
41
|
+
|
|
30
42
|
def nptype(dtype):
|
|
31
43
|
""" converts to numpy types
|
|
32
44
|
|
|
@@ -159,7 +171,7 @@ class NTP(object):
|
|
|
159
171
|
except IndexError:
|
|
160
172
|
if hasattr(array, "shape") and len(array.shape) == 0:
|
|
161
173
|
rank = 0
|
|
162
|
-
if type(array) in [
|
|
174
|
+
if type(array) in [npstring, numpy.str_]:
|
|
163
175
|
pythonDType = "str"
|
|
164
176
|
elif hasattr(array, "dtype"):
|
|
165
177
|
pythonDType = str(array.dtype)
|
|
@@ -170,7 +182,7 @@ class NTP(object):
|
|
|
170
182
|
shape.append(len(array))
|
|
171
183
|
|
|
172
184
|
else:
|
|
173
|
-
if type(array) in [
|
|
185
|
+
if type(array) in [npstring, numpy.str_]:
|
|
174
186
|
pythonDType = "str"
|
|
175
187
|
elif hasattr(array, "dtype"):
|
|
176
188
|
pythonDType = str(array.dtype)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: nxswriter
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.16.0
|
|
4
4
|
Summary: Nexus Data writer implemented as a Tango Server
|
|
5
5
|
Home-page: https://github.com/nexdatas/nxsdatawriter
|
|
6
6
|
Author: Jan Kotanski, Eugen Wintersberger , Halil Pasic
|
|
@@ -23,6 +23,7 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
23
23
|
Classifier: Programming Language :: Python :: 3.10
|
|
24
24
|
Classifier: Programming Language :: Python :: 3.11
|
|
25
25
|
Classifier: Programming Language :: Python :: 3.12
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
26
27
|
Requires-Dist: lxml
|
|
27
28
|
Requires-Dist: numpy (>1.6.0)
|
|
28
29
|
Requires-Dist: nxstools (>=3.50.0)
|
|
@@ -94,7 +95,7 @@ Extract sources and run
|
|
|
94
95
|
Debian packages
|
|
95
96
|
"""""""""""""""
|
|
96
97
|
|
|
97
|
-
Debian `bookworm`, `bullseye`, `buster` or Ubuntu `
|
|
98
|
+
Debian `bookworm`, `bullseye`, `buster` or Ubuntu `plucky`, `noble`, `jammy` packages can be found in the HDRI repository.
|
|
98
99
|
|
|
99
100
|
To install the debian packages, add the PGP repository key
|
|
100
101
|
|
|
@@ -4,7 +4,7 @@ nxswriter/DataHolder.py,sha256=DL08NyY0FG6snsmW0-nQ7JmWJwDc5-Hy2bC4E3Uz1fk,6164
|
|
|
4
4
|
nxswriter/DataSourceFactory.py,sha256=W0IirDjsu38KKvBxFbkvv-ghvqil2JJStQ3WMxo8Kh4,4687
|
|
5
5
|
nxswriter/DataSourcePool.py,sha256=1bDOrHhYpG_ZFz8ut2IzkNSMeGxrCBcSCneM4h1AgDc,4574
|
|
6
6
|
nxswriter/DataSources.py,sha256=l40n4WTfgRjLpFsJs7JoWjsER_dCVviRI_iolQ2fENM,5303
|
|
7
|
-
nxswriter/DecoderPool.py,sha256
|
|
7
|
+
nxswriter/DecoderPool.py,sha256=-eBLujQhuAV81yaFoWirHNULuGSDp4L0ElyFfK-Yj2c,15779
|
|
8
8
|
nxswriter/EAttribute.py,sha256=hADI-LeuQMZwVoTFM4qevoz173Ma_atrk0edqvsFXS0,8878
|
|
9
9
|
nxswriter/EField.py,sha256=YLbdaykGccZ4cjqheS9te50FG6HQq5kfp7gg_OBkJ9k,28034
|
|
10
10
|
nxswriter/EGroup.py,sha256=Y_PuTERckQXfUXGISbnpzHj7I4y2iFxM5CGByjVD6KA,4900
|
|
@@ -23,16 +23,16 @@ nxswriter/NXSFromXML.py,sha256=932BivWZnf-3tnIkbpSRFwfGV0PTwcT9pYb2FMmVd_4,9077
|
|
|
23
23
|
nxswriter/NXSWriter.py,sha256=raHykC9mpUXU8pPtsqePuz3CI-24qYjIUSoyux2zCgo,31345
|
|
24
24
|
nxswriter/NexusXMLHandler.py,sha256=IrZ2mWLuovdBIHcWTqKmr4HZxpMEWLun8A94O6pavr8,14131
|
|
25
25
|
nxswriter/PyEvalSource.py,sha256=7-7Gc2_3CGd3XMHD3LBPCBOZx4Q6b1guzt1xgrSLxMs,11234
|
|
26
|
-
nxswriter/Release.py,sha256=
|
|
26
|
+
nxswriter/Release.py,sha256=WvhVn3E4Fup8cqvu9a_KgMIxI73SQY45aJeFSxzBRvY,900
|
|
27
27
|
nxswriter/StreamSet.py,sha256=sSvXJxoDufmt9_Xu5rFaQsp_4x9gww_zMv0NTiiyLlg,5799
|
|
28
28
|
nxswriter/TangoDataWriter.py,sha256=yP6B3TVUhpHp8OBHKYQRNNtFer9xARoakNXuro4eVv8,28725
|
|
29
29
|
nxswriter/TangoSource.py,sha256=jiFGUsoX2N5-i2gpBqkHi2KjmTBd46TI22Cjkt_2btw,29410
|
|
30
30
|
nxswriter/ThreadPool.py,sha256=TKvOStVUUyuyHowk0MRaBM4GmRKtl0VPVVPdFHu332M,6039
|
|
31
|
-
nxswriter/Types.py,sha256=
|
|
31
|
+
nxswriter/Types.py,sha256=haH578_GqBwWWUhPC6x9KQOubhhEOsxHdI63j0_AkdE,7906
|
|
32
32
|
nxswriter/__init__.py,sha256=M0w3HGjZgfdqjMdQNaLcq5jazqQeRekx84YSbQCA8-0,1760
|
|
33
|
-
nxswriter-3.
|
|
34
|
-
nxswriter-3.
|
|
35
|
-
nxswriter-3.
|
|
36
|
-
nxswriter-3.
|
|
37
|
-
nxswriter-3.
|
|
38
|
-
nxswriter-3.
|
|
33
|
+
nxswriter-3.16.0.data/scripts/NXSDataWriter,sha256=wO3opCCjYttfrY7CITNXHvirXv5W6rIQTY7vX5PmioI,905
|
|
34
|
+
nxswriter-3.16.0.data/scripts/nxsfromxml,sha256=qxnJUtV_ueA3lGnne8ltaOF6yF5YtmzeFLIl3NWkAq8,61
|
|
35
|
+
nxswriter-3.16.0.dist-info/METADATA,sha256=3kKO-rih_oHQUtEzNFizUYwDDpJ3iZ1Ec1akWpKonKo,9013
|
|
36
|
+
nxswriter-3.16.0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
37
|
+
nxswriter-3.16.0.dist-info/top_level.txt,sha256=29dYcOYN2MVz1NKpwobc4Zl4yjhd4VB62LDSuSy7x0Y,10
|
|
38
|
+
nxswriter-3.16.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|