NXtomo.load() fails to load nx file.
Get the following error:
(ub2004_x86) lesaint@scisoft12:/scisoft/lesaint/bamboo_reduced$ ipython
Python 3.8.10 (default, Nov 22 2023, 10:22:35)
Type 'copyright', 'credits' or 'license' for more information
IPython 8.12.3 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from nxtomo.application.nxtomo import NXtomo
In [2]: nx = NXtomo().load('bamboo_reduced.nx','entry0000')
property x_flipped is deprecated since silx version 0.13. Reason: NXtransformation is the nexus way to handle detector transformation. Use 'transformations' instead.
File "/home/esrf/lesaint/envs/ub2004_x86/lib/python3.8/site-packages/nxtomo/nxobject/nxdetector.py", line 209, in x_flipped
deprecated_warning(
property x_flipped is deprecated since silx version 0.13. Reason: NXtransformation is the nexus way to handle detector transformation. Use 'transformations' instead.
File "/home/esrf/lesaint/envs/ub2004_x86/lib/python3.8/site-packages/nxtomo/nxobject/nxdetector.py", line 220, in x_flipped
deprecated_warning(
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[2], line 1
----> 1 nx = NXtomo().load('bamboo_reduced.nx','entry0000')
File ~/envs/ub2004_x86/lib/python3.8/site-packages/nxtomo/application/nxtomo.py:371, in NXtomo.load(self, file_path, data_path, detector_data_as)
364 self.title = get_data(
365 file_path=file_path, data_path="/".join([data_path, nexus_paths.NAME_PATH])
366 )
368 self.sample._load(
369 file_path, "/".join([data_path, "sample"]), nexus_version=nexus_version
370 )
--> 371 self.instrument._load(
372 file_path,
373 "/".join([data_path, "instrument"]),
374 nexus_version=nexus_version,
375 detector_data_as=detector_data_as,
376 )
377 self.control._load(
378 file_path, "/".join([data_path, "control"]), nexus_version=nexus_version
379 )
380 return self
File ~/envs/ub2004_x86/lib/python3.8/site-packages/nxtomo/nxobject/nxinstrument.py:167, in NXinstrument._load(self, file_path, data_path, nexus_version, detector_data_as)
165 # TODO: loading detector might be done using the NXclass instead of some hard coded names
166 if has_detector:
--> 167 self.detector._load(
168 file_path=file_path,
169 data_path="/".join(
170 [data_path, "detector"],
171 ),
172 nexus_version=nexus_version,
173 load_data_as=detector_data_as,
174 )
175 if has_diode:
176 self.diode._load(
177 file_path=file_path,
178 data_path="/".join(
(...)
182 load_data_as="as_numpy_array",
183 )
File ~/envs/ub2004_x86/lib/python3.8/site-packages/nxtomo/nxobject/nxdetector.py:647, in NXdetector._load(self, file_path, data_path, nexus_version, load_data_as)
644 _logger.warning(f"Fail to load y pixel size. Error is {e}")
646 if nexus_detector_paths.X_FLIPPED is not None:
--> 647 self.x_flipped = get_data(
648 file_path=file_path,
649 data_path="/".join([data_path, nexus_detector_paths.X_FLIPPED]),
650 )
651 if nexus_detector_paths.Y_FLIPPED is not None:
652 self.y_flipped = get_data(
653 file_path=file_path,
654 data_path="/".join([data_path, nexus_detector_paths.Y_FLIPPED]),
655 )
File ~/envs/ub2004_x86/lib/python3.8/site-packages/nxtomo/nxobject/nxobject.py:389, in NXobject.__setattr__(self, _NXobject__name, _NXobject__value)
387 raise AttributeError("can't set attribute", __name)
388 else:
--> 389 super().__setattr__(__name, __value)
File ~/envs/ub2004_x86/lib/python3.8/site-packages/nxtomo/nxobject/nxdetector.py:230, in NXdetector.x_flipped(self, flipped)
227 # WARNING: moving from two simple boolean to full NXtransformations make the old API very weak. It should be removed
228 # soon (but we want to keep the API for at least one release). This is expected to fail except if you stick to {x,y} flips
229 if not isinstance(flipped, (bool, type(None))):
--> 230 raise TypeError
231 current_lr_transfs = get_lr_flip(self.transformations)
232 if flipped:
TypeError: