sardana-nxsrecorder 3.18.0__py3-none-any.whl → 3.19.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.
@@ -1,13 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sardana-nxsrecorder
3
- Version: 3.18.0
3
+ Version: 3.19.0
4
4
  Summary: NeXus Sardana Scan Recorder
5
5
  Home-page: https://github.com/nexdatas/sardana-nxs-filerecorder/
6
6
  Author: Jan Kotanski
7
7
  Author-email: jankotan@gmail.com
8
8
  License: GNU GENERAL PUBLIC LICENSE v3
9
9
  Keywords: NeXus sardana scan recorder data
10
- Platform: UNKNOWN
11
10
  Classifier: Development Status :: 5 - Production/Stable
12
11
  Classifier: Intended Audience :: Science/Research
13
12
  Classifier: Topic :: Scientific/Engineering :: Physics
@@ -248,5 +247,3 @@ The NeXus file recorder uses the following sardana environment variables
248
247
  * **SciCatDatasetListFileLocal** *(bool)* - add the hostname to the scicat dataset list file extension, default: ``False``
249
248
  * **SciCatAutoGrouping** *(bool)* - group all scans with the measurement name set to the base scan filename, default: ``False``
250
249
  * **MetadataScript** *(str)* - a python module file name containing ``main()`` which provides a dictionary with user metadata stored in the INIT mode, default: ``""``
251
-
252
-
@@ -0,0 +1,6 @@
1
+ sardananxsrecorder/__init__.py,sha256=rLcTXm_38KYJIRnRCt1AfVFOQ2GhZpYWKK2oUylp-Pk,896
2
+ sardananxsrecorder/nxsrecorder.py,sha256=uzkFUa_-wU56pNyo_EAp-cV5eC-W4O4psOh9nO-NHKA,50834
3
+ sardana_nxsrecorder-3.19.0.dist-info/METADATA,sha256=MVRRZwJnbuW2_JkreByCSKsrdZY-ogqzfTMXjpzp6L0,7269
4
+ sardana_nxsrecorder-3.19.0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
5
+ sardana_nxsrecorder-3.19.0.dist-info/top_level.txt,sha256=YdD3m417i-jlYyQWgiizgZ8lQQcOjM8y-bmUHrGkfY4,19
6
+ sardana_nxsrecorder-3.19.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.34.2)
2
+ Generator: bdist_wheel (0.38.4)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -20,4 +20,4 @@
20
20
  """ Sardana Scan Recorders """
21
21
 
22
22
  #: package version
23
- __version__ = "3.18.0"
23
+ __version__ = "3.19.0"
@@ -508,7 +508,7 @@ class NXS_FileRecorder(BaseFileRecorder):
508
508
  self.__nexuswriter_device = None
509
509
  self.warning("Cannot connect to '%s' " % servers[0])
510
510
  if self.__macro:
511
- self.__macro().Wwarning(
511
+ self.__macro().warning(
512
512
  "Cannot connect to '%s'" % servers[0])
513
513
  else:
514
514
  self.__nexuswriter_device = None
@@ -956,6 +956,14 @@ class NXS_FileRecorder(BaseFileRecorder):
956
956
  if appendentry else ""
957
957
  self.__vars["vars"]["scan_id"] = envRec["serialno"]
958
958
  self.__vars["vars"]["scan_title"] = envRec["title"]
959
+ if self.__macro:
960
+ if hasattr(self.__macro(), "integ_time"):
961
+ self.__vars["vars"]["count_time"] = \
962
+ self.__macro().integ_time
963
+ if hasattr(self.__macro(), "nb_points"):
964
+ self.__vars["vars"]["npoints"] = \
965
+ self.__macro().nb_points
966
+ self.__vars["vars"]["beamtime_id"] = self.beamtimeid()
959
967
  tzone = self.__getConfVar("TimeZone", self.__timezone)
960
968
  self.__vars["data"]["start_time"] = \
961
969
  self.__timeToString(envRec['starttime'], tzone)
@@ -970,6 +978,15 @@ class NXS_FileRecorder(BaseFileRecorder):
970
978
 
971
979
  self.__vars["data"]["serialno"] = envRec["serialno"]
972
980
  self.__vars["data"]["scan_title"] = envRec["title"]
981
+ if self.__macro:
982
+ if hasattr(self.__macro(), "integ_time"):
983
+ self.__vars["data"]["count_time"] = \
984
+ self.__macro().integ_time
985
+ if hasattr(self.__macro(), "nb_points"):
986
+ self.__vars["data"]["npoints"] = \
987
+ self.__macro().nb_points
988
+ self.__vars["data"]["beamtime_id"] = \
989
+ self.__vars["vars"]["beamtime_id"]
973
990
 
974
991
  if hasattr(self.__nexuswriter_device, 'Init'):
975
992
  self.__command(self.__nexuswriter_device, "Init")
@@ -1020,8 +1037,10 @@ class NXS_FileRecorder(BaseFileRecorder):
1020
1037
  self.__macro().warning(
1021
1038
  "NXS_FileRecorder: %s does not exist" % msf)
1022
1039
  else:
1023
- import imp
1024
- msm = imp.load_source('', msf)
1040
+ import importlib.util
1041
+ spec = importlib.util.spec_from_file_location('', msf)
1042
+ msm = importlib.util.module_from_spec(spec)
1043
+ spec.loader.exec_module(msm)
1025
1044
  ms = msm.main()
1026
1045
  if not isinstance(ms, dict):
1027
1046
  self.warning(
@@ -1164,19 +1183,21 @@ class NXS_FileRecorder(BaseFileRecorder):
1164
1183
  pass
1165
1184
  return result
1166
1185
 
1186
+ def beamtimeid(self):
1187
+ bmtfpath = self.__getEnvVar("BeamtimeFilePath", "/gpfs/current")
1188
+ bmtfprefix = self.__getEnvVar(
1189
+ "BeamtimeFilePrefix", "beamtime-metadata-")
1190
+ bmtfext = self.__getEnvVar("BeamtimeFileExt", ".json")
1191
+ beamtimeid = self.beamtime_id(bmtfpath, bmtfprefix, bmtfext)
1192
+ return beamtimeid or "00000000"
1193
+
1167
1194
  def __appendSciCatDataset(self, hostname=None):
1168
1195
  """ append dataset to SciCat ingestion list """
1169
1196
 
1170
1197
  fdir, fname = os.path.split(self.filename)
1171
1198
  _, bfname = os.path.split(self.__base_filename)
1172
1199
  sname, fext = os.path.splitext(fname)
1173
-
1174
- bmtfpath = self.__getEnvVar("BeamtimeFilePath", "/gpfs/current")
1175
- bmtfprefix = self.__getEnvVar(
1176
- "BeamtimeFilePrefix", "beamtime-metadata-")
1177
- bmtfext = self.__getEnvVar("BeamtimeFileExt", ".json")
1178
- beamtimeid = self.beamtime_id(bmtfpath, bmtfprefix, bmtfext)
1179
- beamtimeid = beamtimeid or "00000000"
1200
+ beamtimeid = self.beamtimeid()
1180
1201
  defprefix = "scicat-datasets-"
1181
1202
  defaulthost = self.__getEnvVar("SciCatDatasetListFileLocal", None)
1182
1203
  if defaulthost:
@@ -1201,7 +1222,7 @@ class NXS_FileRecorder(BaseFileRecorder):
1201
1222
 
1202
1223
  if appendentry is True:
1203
1224
  sid = self.__getEnvVar("ScanID", 0)
1204
- sname = "%s::/%s%05i;%s_%05i" % (
1225
+ sname = "%s::/%s%i;%s_%05i" % (
1205
1226
  scanname, entryname, sid, scanname, sid)
1206
1227
 
1207
1228
  # auto grouping
@@ -1,6 +0,0 @@
1
- sardananxsrecorder/__init__.py,sha256=vvqGk7lQt5kOZdF1vRWXKQFWI94Ex8pLzFFAVGC81go,896
2
- sardananxsrecorder/nxsrecorder.py,sha256=zyJV_rKVCqdpe9QGauNPHOBtjcN8ogqESHXE9WXneeY,49749
3
- sardana_nxsrecorder-3.18.0.dist-info/METADATA,sha256=ezc1RTlzgQIjSwIPUgqOoxBjR4cwDvipR_3ZS-BVee0,7289
4
- sardana_nxsrecorder-3.18.0.dist-info/WHEEL,sha256=g4nMs7d-Xl9-xC9XovUrsDHGXt-FT0E17Yqo92DEfvY,92
5
- sardana_nxsrecorder-3.18.0.dist-info/top_level.txt,sha256=YdD3m417i-jlYyQWgiizgZ8lQQcOjM8y-bmUHrGkfY4,19
6
- sardana_nxsrecorder-3.18.0.dist-info/RECORD,,