sardana-nxsrecorder 3.25.0__tar.gz → 3.26.1__tar.gz

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.
Files changed (40) hide show
  1. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/ChangeLog +8 -0
  2. {sardana-nxsrecorder-3.25.0/sardana_nxsrecorder.egg-info → sardana-nxsrecorder-3.26.1}/PKG-INFO +2 -2
  3. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/README.rst +1 -1
  4. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/man/sardananxsrecorder.1 +3 -3
  5. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1/sardana_nxsrecorder.egg-info}/PKG-INFO +2 -2
  6. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/sardananxsrecorder/__init__.py +1 -1
  7. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/sardananxsrecorder/nxsrecorder.py +41 -27
  8. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/.ci/debian10_py2/Dockerfile +0 -0
  9. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/.ci/debian10_py3/Dockerfile +0 -0
  10. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/.ci/debian8_py2/Dockerfile +0 -0
  11. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/.ci/debian8_py3/Dockerfile +0 -0
  12. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/.ci/debian9_py2/Dockerfile +0 -0
  13. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/.ci/debian9_py3/Dockerfile +0 -0
  14. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/.ci/install.sh +0 -0
  15. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/.ci/run.sh +0 -0
  16. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/.ci/ubuntu16.04_py2/Dockerfile +0 -0
  17. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/.ci/ubuntu16.04_py3/Dockerfile +0 -0
  18. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/.ci/ubuntu18.04_py2/Dockerfile +0 -0
  19. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/.ci/ubuntu18.04_py3/Dockerfile +0 -0
  20. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/.ci/ubuntu20.04_py3/Dockerfile +0 -0
  21. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/.flake8 +0 -0
  22. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/.github/workflows/tests.yml +0 -0
  23. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/.gitignore +0 -0
  24. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/COPYRIGHT +0 -0
  25. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/MANIFEST.in +0 -0
  26. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/doc/Makefile +0 -0
  27. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/doc/conf.py +0 -0
  28. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/doc/index.rst +0 -0
  29. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/doc/make.bat +0 -0
  30. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/doc/sardananxsrecorder.rst +0 -0
  31. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/sardana_nxsrecorder.egg-info/SOURCES.txt +0 -0
  32. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/sardana_nxsrecorder.egg-info/dependency_links.txt +0 -0
  33. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/sardana_nxsrecorder.egg-info/not-zip-safe +0 -0
  34. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/sardana_nxsrecorder.egg-info/requires.txt +0 -0
  35. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/sardana_nxsrecorder.egg-info/top_level.txt +0 -0
  36. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/setup.cfg +0 -0
  37. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/setup.py +0 -0
  38. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/test/__init__.py +0 -0
  39. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/test/__main__.py +0 -0
  40. {sardana-nxsrecorder-3.25.0 → sardana-nxsrecorder-3.26.1}/test/main.py +0 -0
@@ -1,3 +1,11 @@
1
+ 2024-07-03 Jan Kotanski <jankotan@gmail.com>
2
+ * fix for summer time parsing (#132)
3
+ * tagged as 3.26.1
4
+
5
+ 2024-06-19 Jan Kotanski <jankotan@gmail.com>
6
+ * replace NeXusSkipAcquisitionModes by NeXusWriterModes variable (#127)
7
+ * tagged as 3.26.0
8
+
1
9
  2024-06-07 Jan Kotanski <jankotan@gmail.com>
2
10
  * set NeXusMeshScanID variable (#124)
3
11
  * tagged as 3.25.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sardana-nxsrecorder
3
- Version: 3.25.0
3
+ Version: 3.26.1
4
4
  Summary: NeXus Sardana Scan Recorder
5
5
  Home-page: https://github.com/nexdatas/sardana-nxs-filerecorder/
6
6
  Author: Jan Kotanski
@@ -249,7 +249,7 @@ The NeXus file recorder uses the following sardana environment variables
249
249
  * **MetadataScript** *(str)* - a python module file name containing ``main()`` which provides a dictionary with user metadata stored in the INIT mode, default: ``""``
250
250
  * **ScicatMeasurements** *(dict)* - a dictionary of measurement names indexed by ``ScanDir`` and used by ``scingestor``, default: ``{}``
251
251
  * **CreateMeasurementFile** *(bool)* - create a measurement file with its filename releated to ``ScicatMeasurements`` or ``ScanFile``, default: ``False``
252
- * **NeXusSkipAcquisitionModes** *(list)* - a list of strategy modes for which acquisition is skip
253
252
  * **NeXusWriterProperties** *(dict)* - a dictionary of TangoDataWriter (NXSDataWriter) properties (starting with a small letter)
254
253
  * **NeXusMeshScanID** *(int)* - ScanID used for composed scans e.g. mesh scan combined from many linear scans
254
+ * **NeXusWriterModes** *(list)* - a list of strategy modes e.g. ``NOINIT``, ``NOSTEP``, ``NOFINAL``, ``MESH``, ``VDS`` separated by commas
255
255
 
@@ -224,7 +224,7 @@ The NeXus file recorder uses the following sardana environment variables
224
224
  * **MetadataScript** *(str)* - a python module file name containing ``main()`` which provides a dictionary with user metadata stored in the INIT mode, default: ``""``
225
225
  * **ScicatMeasurements** *(dict)* - a dictionary of measurement names indexed by ``ScanDir`` and used by ``scingestor``, default: ``{}``
226
226
  * **CreateMeasurementFile** *(bool)* - create a measurement file with its filename releated to ``ScicatMeasurements`` or ``ScanFile``, default: ``False``
227
- * **NeXusSkipAcquisitionModes** *(list)* - a list of strategy modes for which acquisition is skip
228
227
  * **NeXusWriterProperties** *(dict)* - a dictionary of TangoDataWriter (NXSDataWriter) properties (starting with a small letter)
229
228
  * **NeXusMeshScanID** *(int)* - ScanID used for composed scans e.g. mesh scan combined from many linear scans
229
+ * **NeXusWriterModes** *(list)* - a list of strategy modes e.g. ``NOINIT``, ``NOSTEP``, ``NOFINAL``, ``MESH``, ``VDS`` separated by commas
230
230
 
@@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
27
27
  .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28
28
  .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
29
29
  ..
30
- .TH "SARDANANXSRECORDER" "1" "Jun 06, 2024" "3.25" "Sardana NeXus Recorder"
30
+ .TH "SARDANANXSRECORDER" "1" "Jun 11, 2024" "3.26" "Sardana NeXus Recorder"
31
31
  .SH NAME
32
32
  sardananxsrecorder \- sardananxsrecorder Documentation
33
33
  .sp
@@ -354,11 +354,11 @@ The NeXus file recorder uses the following sardana environment variables
354
354
  .IP \(bu 2
355
355
  \fBCreateMeasurementFile\fP \fI(bool)\fP \- create a measurement file with its filename releated to \fBScicatMeasurements\fP or \fBScanFile\fP, default: \fBFalse\fP
356
356
  .IP \(bu 2
357
- \fBNeXusSkipAcquisitionModes\fP \fI(list)\fP \- a list of strategy modes for which acquisition is skip
358
- .IP \(bu 2
359
357
  \fBNeXusWriterProperties\fP \fI(dict)\fP \- a dictionary of TangoDataWriter (NXSDataWriter) properties (starting with a small letter)
360
358
  .IP \(bu 2
361
359
  \fBNeXusMeshScanID\fP \fI(int)\fP \- ScanID used for composed scans e.g. mesh scan combined from many linear scans
360
+ .IP \(bu 2
361
+ \fBNeXusWriterModes\fP \fI(list)\fP \- a list of strategy modes e.g. \fBNOINIT\fP, \fBNOSTEP\fP, \fBNOFINAL\fP, \fBMESH\fP, \fBVDS\fP separated by commas
362
362
  .UNINDENT
363
363
  .sp
364
364
  Contents:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sardana-nxsrecorder
3
- Version: 3.25.0
3
+ Version: 3.26.1
4
4
  Summary: NeXus Sardana Scan Recorder
5
5
  Home-page: https://github.com/nexdatas/sardana-nxs-filerecorder/
6
6
  Author: Jan Kotanski
@@ -249,7 +249,7 @@ The NeXus file recorder uses the following sardana environment variables
249
249
  * **MetadataScript** *(str)* - a python module file name containing ``main()`` which provides a dictionary with user metadata stored in the INIT mode, default: ``""``
250
250
  * **ScicatMeasurements** *(dict)* - a dictionary of measurement names indexed by ``ScanDir`` and used by ``scingestor``, default: ``{}``
251
251
  * **CreateMeasurementFile** *(bool)* - create a measurement file with its filename releated to ``ScicatMeasurements`` or ``ScanFile``, default: ``False``
252
- * **NeXusSkipAcquisitionModes** *(list)* - a list of strategy modes for which acquisition is skip
253
252
  * **NeXusWriterProperties** *(dict)* - a dictionary of TangoDataWriter (NXSDataWriter) properties (starting with a small letter)
254
253
  * **NeXusMeshScanID** *(int)* - ScanID used for composed scans e.g. mesh scan combined from many linear scans
254
+ * **NeXusWriterModes** *(list)* - a list of strategy modes e.g. ``NOINIT``, ``NOSTEP``, ``NOFINAL``, ``MESH``, ``VDS`` separated by commas
255
255
 
@@ -20,4 +20,4 @@
20
20
  """ Sardana Scan Recorders """
21
21
 
22
22
  #: package version
23
- __version__ = "3.25.0"
23
+ __version__ = "3.26.1"
@@ -26,7 +26,6 @@ import sys
26
26
 
27
27
  import numpy
28
28
  import json
29
- import pytz
30
29
  import time
31
30
  import weakref
32
31
  import socket
@@ -158,8 +157,9 @@ class NXS_FileRecorder(BaseFileRecorder):
158
157
  #: (:obj:`dict` <:obj:`str` , :obj:`str`>) NeXus configuration
159
158
  self.__conf = {}
160
159
 
161
- #: (:obj:`list` <:obj:`str`>) skip Acquisition Modes
162
- self.skipAcquisitionModes = self.__skipAcquisitionModes()
160
+ #: (:obj:`list` <:obj:`str`>) acquisition Modes
161
+ self.writerModes = self.__variableList(
162
+ "NeXusWriterModes")
163
163
 
164
164
  #: (:obj:`dict` <:obj:`str` , `any`>) User data
165
165
  self.__udata = None
@@ -177,7 +177,8 @@ class NXS_FileRecorder(BaseFileRecorder):
177
177
 
178
178
  def _serial(self, scanID):
179
179
  serial = None
180
- if "INIT" in self.skipAcquisitionModes:
180
+ if "NOINIT" in self.writerModes and \
181
+ "MESH" in self.writerModes:
181
182
  if self.__macro:
182
183
  serial = self.__macro().getEnv('NeXusMeshScanID', None)
183
184
  if serial is None:
@@ -188,8 +189,8 @@ class NXS_FileRecorder(BaseFileRecorder):
188
189
  serial = scanID
189
190
  else:
190
191
  serial = scanID + 1
191
- if self.skipAcquisitionModes and \
192
- "INIT" not in self.skipAcquisitionModes:
192
+ if "MESH" in self.writerModes and \
193
+ "NOINIT" not in self.writerModes:
193
194
  if self.__macro:
194
195
  self.__macro().setEnv('NeXusMeshScanID', serial)
195
196
  return serial
@@ -1012,6 +1013,8 @@ class NXS_FileRecorder(BaseFileRecorder):
1012
1013
  self.__vars["vars"]["serialno"] = ("_%05i" % self.__serial) \
1013
1014
  if appendscanid else ""
1014
1015
  self.__vars["vars"]["scan_id"] = envRec["serialno"]
1016
+ self.__vars["vars"]["acq_modes"] = \
1017
+ ",".join(self.writerModes or [])
1015
1018
  self.__vars["vars"]["scan_title"] = envRec["title"]
1016
1019
  if self.__macro:
1017
1020
  if hasattr(self.__macro(), "integ_time"):
@@ -1054,8 +1057,9 @@ class NXS_FileRecorder(BaseFileRecorder):
1054
1057
  # self.debug('START_DATA: %s' % str(envRec))
1055
1058
 
1056
1059
  self.__nexuswriter_device.jsonrecord = rec
1057
- self.skipAcquisitionModes = self.__skipAcquisitionModes()
1058
- if "INIT" in self.skipAcquisitionModes:
1060
+ self.writerModes = self.__variableList(
1061
+ "NeXusWriterModes")
1062
+ if "NOINIT" in self.writerModes:
1059
1063
  self.__nexuswriter_device.skipAcquisition = True
1060
1064
 
1061
1065
  self.__command(self.__nexuswriter_device, "openEntry")
@@ -1144,7 +1148,7 @@ class NXS_FileRecorder(BaseFileRecorder):
1144
1148
  rec = json.dumps(
1145
1149
  envrecord, cls=NXS_FileRecorder.numpyEncoder)
1146
1150
  self.__nexuswriter_device.jsonrecord = rec
1147
- if "STEP" in self.skipAcquisitionModes:
1151
+ if "NOSTEP" in self.writerModes:
1148
1152
  self.__nexuswriter_device.skipAcquisition = True
1149
1153
 
1150
1154
  # self.debug('DATA: {"data":%s}' % json.dumps(
@@ -1170,8 +1174,16 @@ class NXS_FileRecorder(BaseFileRecorder):
1170
1174
  :returns: formatted time string
1171
1175
  :rtype: :obj:`str`
1172
1176
  """
1177
+ fmt = '%Y-%m-%dT%H:%M:%S.%f%z'
1173
1178
  try:
1174
- tz = pytz.timezone(tzone)
1179
+ if sys.version_info >= (3, 9):
1180
+ import zoneinfo
1181
+ tz = zoneinfo.ZoneInfo(tzone)
1182
+ starttime = mtime.replace(tzinfo=tz)
1183
+ else:
1184
+ import pytz
1185
+ tz = pytz.timezone(tzone)
1186
+ starttime = tz.localize(mtime)
1175
1187
  except Exception:
1176
1188
  self.warning(
1177
1189
  "Wrong TimeZone. "
@@ -1180,13 +1192,15 @@ class NXS_FileRecorder(BaseFileRecorder):
1180
1192
  self.__macro().warning(
1181
1193
  "Wrong TimeZone. "
1182
1194
  "The time zone set to `%s`" % self.__timezone)
1183
- tz = pytz.timezone(self.__timezone)
1195
+ if sys.version_info >= (3, 9):
1196
+ import zoneinfo
1197
+ tz = zoneinfo.ZoneInfo(self.__timezone)
1198
+ starttime = mtime.replace(tzinfo=tz)
1199
+ else:
1200
+ import pytz
1201
+ tz = pytz.timezone(self.__timezone)
1202
+ starttime = tz.localize(mtime)
1184
1203
 
1185
- fmt = '%Y-%m-%dT%H:%M:%S.%f%z'
1186
- if sys.version_info > (3, 6):
1187
- starttime = mtime.replace(tzinfo=tz)
1188
- else:
1189
- starttime = tz.localize(mtime)
1190
1204
  return str(starttime.strftime(fmt))
1191
1205
 
1192
1206
  def _endRecordList(self, recordlist):
@@ -1214,7 +1228,7 @@ class NXS_FileRecorder(BaseFileRecorder):
1214
1228
  rec = json.dumps(
1215
1229
  envrecord, cls=NXS_FileRecorder.numpyEncoder)
1216
1230
  self.__nexuswriter_device.jsonrecord = rec
1217
- if "FINAL" in self.skipAcquisitionModes:
1231
+ if "NOFINAL" in self.writerModes:
1218
1232
  self.__nexuswriter_device.skipAcquisition = True
1219
1233
  self.__command(self.__nexuswriter_device, "closeEntry")
1220
1234
  self.__command(self.__nexuswriter_device, "closeFile")
@@ -1262,18 +1276,18 @@ class NXS_FileRecorder(BaseFileRecorder):
1262
1276
  beamtimeid = self.beamtime_id(bmtfpath, bmtfprefix, bmtfext)
1263
1277
  return beamtimeid or "00000000"
1264
1278
 
1265
- def __skipAcquisitionModes(self):
1266
- """ find skip acquisition modes
1279
+ def __variableList(self, variable='NeXusWriterModes'):
1280
+ """ read variable list
1267
1281
  """
1268
1282
  try:
1269
- skip_acq = self.__macro().getEnv('NeXusSkipAcquisitionModes')
1283
+ msvar = self.__macro().getEnv(variable)
1270
1284
  except Exception:
1271
- skip_acq = []
1272
- if isinstance(skip_acq, str):
1273
- skip_acq = re.split(r"[-;,.\s]\s*", skip_acq)
1274
- if skip_acq:
1275
- self.debug('Skip Acquisition Modes: %s' % str(skip_acq))
1276
- return skip_acq
1285
+ msvar = []
1286
+ if isinstance(msvar, str):
1287
+ msvar = re.split(r"[-;,.\s]\s*", msvar)
1288
+ if msvar:
1289
+ self.debug('%s: %s' % (variable, str(msvar)))
1290
+ return msvar
1277
1291
 
1278
1292
  def __rawfilename(self, serial):
1279
1293
  """ find scan name
@@ -1364,7 +1378,7 @@ class NXS_FileRecorder(BaseFileRecorder):
1364
1378
  sid = self.__serial
1365
1379
  sname = "%s::/%s_%05i;%s_%05i" % (
1366
1380
  scanname, entryname, sid, scanname, sid)
1367
- if "INIT" in self.skipAcquisitionModes:
1381
+ if "NOINIT" in self.writerModes:
1368
1382
  sname = "%s:%s" % (sname, time.time())
1369
1383
 
1370
1384
  # auto grouping