nxtomomill 2.2.0.dev1__py3-none-any.whl → 2.2.0.dev3__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.
Files changed (61) hide show
  1. nxtomomill/app/dxfile2nx.py +2 -3
  2. nxtomomill/app/edf2nx.py +3 -3
  3. nxtomomill/app/edf2nx_check.py +3 -3
  4. nxtomomill/app/h52nx.py +49 -4
  5. nxtomomill/app/patch_nx.py +3 -6
  6. nxtomomill/app/tests/test_bliss_fluo2nx_app.py +9 -9
  7. nxtomomill/app/tests/test_fluo2nx_app.py +15 -15
  8. nxtomomill/app/zstages2nxs.py +4 -2
  9. nxtomomill/converter/dxfile/dxfileconverter.py +7 -7
  10. nxtomomill/converter/edf/edfconverter.py +3 -3
  11. nxtomomill/converter/edf/tests/test_edf2nx.py +3 -3
  12. nxtomomill/converter/fluo/fluoscan.py +0 -1
  13. nxtomomill/converter/fluo/tests/test_fluoscan2D.py +12 -8
  14. nxtomomill/converter/fluo/tests/test_fluoscan3D.py +9 -7
  15. nxtomomill/converter/fscan/fscanconverter.py +1 -1
  16. nxtomomill/converter/hdf5/acquisition/baseacquisition.py +179 -115
  17. nxtomomill/converter/hdf5/acquisition/multitomo.py +63 -4
  18. nxtomomill/converter/hdf5/acquisition/standardacquisition.py +36 -21
  19. nxtomomill/converter/hdf5/acquisition/tests/test_acquisition.py +75 -6
  20. nxtomomill/converter/hdf5/acquisition/tests/test_acquisition_utils.py +3 -1
  21. nxtomomill/converter/hdf5/acquisition/tests/test_multitomoacquisition.py +63 -0
  22. nxtomomill/converter/hdf5/acquisition/utils/_context.py +4 -3
  23. nxtomomill/converter/hdf5/acquisition/utils/_keys.py +19 -0
  24. nxtomomill/converter/hdf5/acquisitionConstructor.py +7 -8
  25. nxtomomill/converter/hdf5/hdf5converter.py +44 -11
  26. nxtomomill/converter/hdf5/tests/test_err_handling.py +48 -0
  27. nxtomomill/converter/hdf5/tests/test_h52nx_utils.py +29 -10
  28. nxtomomill/converter/hdf5/tests/test_hdf5converter.py +204 -36
  29. nxtomomill/converter/hdf5/tests/test_processed_data_layout.py +251 -0
  30. nxtomomill/converter/hdf5/utils.py +99 -28
  31. nxtomomill/io/config/confighandler.py +7 -9
  32. nxtomomill/io/config/tests/test_confighandler.py +30 -0
  33. nxtomomill/models/base/NestedModelBase.py +0 -1
  34. nxtomomill/models/base/instrument_section.py +0 -1
  35. nxtomomill/models/base/source_section.py +0 -1
  36. nxtomomill/models/dx2nx.py +9 -0
  37. nxtomomill/models/edf2nx/dark_and_flat_section.py +0 -1
  38. nxtomomill/models/edf2nx/detector_section.py +0 -1
  39. nxtomomill/models/edf2nx/general_section.py +6 -3
  40. nxtomomill/models/edf2nx/keys_section.py +0 -1
  41. nxtomomill/models/edf2nx/sample_section.py +0 -1
  42. nxtomomill/models/edf2nx/unit_section.py +3 -1
  43. nxtomomill/models/fluo2nx/fluo2nx.py +0 -1
  44. nxtomomill/models/fluo2nx/general_section.py +0 -1
  45. nxtomomill/models/h52nx/_context.py +2 -1
  46. nxtomomill/models/h52nx/entries_and_title_section.py +0 -1
  47. nxtomomill/models/h52nx/extra_params_section.py +0 -1
  48. nxtomomill/models/h52nx/frame_type_section.py +0 -1
  49. nxtomomill/models/h52nx/general_section.py +6 -2
  50. nxtomomill/models/h52nx/keys_section.py +3 -1
  51. nxtomomill/models/h52nx/multitomo_section.py +20 -3
  52. nxtomomill/models/tests/test_edf2nx_model.py +12 -0
  53. nxtomomill/models/tests/test_h52nx_model.py +27 -2
  54. nxtomomill/utils/flat_reducer.py +4 -4
  55. nxtomomill/utils/tests/test_utils.py +3 -3
  56. {nxtomomill-2.2.0.dev1.dist-info → nxtomomill-2.2.0.dev3.dist-info}/METADATA +3 -1
  57. {nxtomomill-2.2.0.dev1.dist-info → nxtomomill-2.2.0.dev3.dist-info}/RECORD +61 -59
  58. {nxtomomill-2.2.0.dev1.dist-info → nxtomomill-2.2.0.dev3.dist-info}/WHEEL +1 -1
  59. {nxtomomill-2.2.0.dev1.dist-info → nxtomomill-2.2.0.dev3.dist-info}/entry_points.txt +0 -0
  60. {nxtomomill-2.2.0.dev1.dist-info → nxtomomill-2.2.0.dev3.dist-info}/licenses/LICENSE +0 -0
  61. {nxtomomill-2.2.0.dev1.dist-info → nxtomomill-2.2.0.dev3.dist-info}/top_level.txt +0 -0
@@ -61,10 +61,9 @@ def _get_pixel_size(input_str) -> tuple:
61
61
  def main(argv):
62
62
  """ """
63
63
  parser = argparse.ArgumentParser(
64
- description="convert acquisition contained in provided dx file to "
65
- "NXTomo entry"
64
+ description="convert acquisition contained in provided dx file to NXTomo entry"
66
65
  )
67
- parser.add_argument("input_file", help="master file of the " "acquisition")
66
+ parser.add_argument("input_file", help="master file of the acquisition")
68
67
  parser.add_argument("output_file", help="output .nx or .h5 file", default=None)
69
68
  # usually it looks like the dxfile contains only one acquisition at the
70
69
  # root level
nxtomomill/app/edf2nx.py CHANGED
@@ -105,9 +105,9 @@ def main(argv):
105
105
  config.force_angle_calculation = not options.use_existing_angles
106
106
  config.output_checks = convert_str_to_tuple(options.output_checks)
107
107
 
108
- assert isinstance(
109
- config.output_checks, tuple
110
- ), f"config.output_checks is expected to be a tuple. Gets {type(config.output_checks)}"
108
+ assert isinstance(config.output_checks, tuple), (
109
+ f"config.output_checks is expected to be a tuple. Gets {type(config.output_checks)}"
110
+ )
111
111
  with tqdm(desc="edf2nx", bar_format="{l_bar}{bar}{postfix}") as progress:
112
112
  converter.from_edf_to_nx(
113
113
  configuration=config,
@@ -93,9 +93,9 @@ def main(argv):
93
93
  if not len(config.output_checks) > 0:
94
94
  raise ValueError("not check on conversion selected")
95
95
 
96
- assert isinstance(
97
- config.output_checks, tuple
98
- ), f"config.output_checks is expected to be a tuple. Gets {type(config.output_checks)}"
96
+ assert isinstance(config.output_checks, tuple), (
97
+ f"config.output_checks is expected to be a tuple. Gets {type(config.output_checks)}"
98
+ )
99
99
  post_processing_check(
100
100
  configuration=config,
101
101
  )
nxtomomill/app/h52nx.py CHANGED
@@ -10,7 +10,9 @@ For a complete tutorial you can have a look at: :ref:`Tomoh52nx`
10
10
  """
11
11
 
12
12
  import argparse
13
+ import cProfile
13
14
  import logging
15
+ import os
14
16
 
15
17
  from tqdm import tqdm
16
18
 
@@ -60,7 +62,7 @@ def main(argv):
60
62
  "`NXtomo` classes. For `zseries` it will create one entry per `z`"
61
63
  )
62
64
  parser.add_argument(
63
- "input_file", help="master file of the " "acquisition", default=None, nargs="?"
65
+ "input_file", help="master file of the acquisition", default=None, nargs="?"
64
66
  )
65
67
  parser.add_argument(
66
68
  "output_file", help="output .nx or .h5 file", default=None, nargs="?"
@@ -242,6 +244,18 @@ def main(argv):
242
244
  default=None,
243
245
  help="Titles corresponding to multi-tomo init scans",
244
246
  )
247
+ parser.add_argument(
248
+ "--multitomo-angle-interval",
249
+ "--multitomo_angle_interval",
250
+ "--angle-interval-in-degree",
251
+ "--angle_interval_in_degree",
252
+ dest="angle_interval_in_degree",
253
+ type=int,
254
+ default=None,
255
+ help="Multi-tomo (v2) only: angle interval (in degree) covered by each NXtomo created. Usually 180 or 360. "
256
+ "For example a multi-tomo acquired with 360 degree turns can be split into NXtomos of 180 degree. "
257
+ "If not provided will create one NXtomo per turn.",
258
+ )
245
259
  parser.add_argument(
246
260
  "--back-and-forth-init-titles",
247
261
  "--back_and_forth_init_titles",
@@ -303,8 +317,7 @@ def main(argv):
303
317
  "--configuration",
304
318
  "--configuration-file",
305
319
  default=None,
306
- help="file containing the full configuration to convert from h5 "
307
- "bliss to nexus",
320
+ help="file containing the full configuration to convert from h5 bliss to nexus",
308
321
  )
309
322
  parser.add_argument(
310
323
  "--use-abs-path-for-vds",
@@ -331,12 +344,35 @@ def main(argv):
331
344
  "links to the raw data. Defaults to the 'NXTOMOMILL_RESOLVE_VDS' "
332
345
  "environment variable if set, else resolving is enabled.",
333
346
  )
347
+ parser.add_argument(
348
+ "--profiling",
349
+ "--profile",
350
+ help="Profile the conversion with 'cProfile' and dump the statistics "
351
+ "to a file (see '--profiling-output-file').",
352
+ action="store_true",
353
+ default=False,
354
+ )
355
+ parser.add_argument(
356
+ "--profiling-output-file",
357
+ "--profiling_output_file",
358
+ default="profiling.out",
359
+ help="Output file to dump the 'cProfile' statistics to when "
360
+ "'--profiling' is provided. If this file already exists the "
361
+ "conversion won't be launched (default: 'profiling.out').",
362
+ )
334
363
  options = parser.parse_args(argv[1:])
335
364
  if options.request_input:
336
365
  callback_det_sel = _ask_for_selecting_detector
337
366
  else:
338
367
  callback_det_sel = None
339
368
 
369
+ if options.profiling and os.path.exists(options.profiling_output_file):
370
+ _logger.error(
371
+ f"Profiling output file already exists: '{options.profiling_output_file}'. "
372
+ "Remove it or provide another one with '--profiling-output-file'."
373
+ )
374
+ return 1
375
+
340
376
  try:
341
377
  configuration_handler = TomoHDF5ConfigHandler(options)
342
378
  except Exception:
@@ -355,6 +391,15 @@ def main(argv):
355
391
  input_callback=None,
356
392
  detector_sel_callback=callback_det_sel,
357
393
  )
358
- converter.convert()
394
+ if options.profiling:
395
+ profiler = cProfile.Profile()
396
+ profiler.enable()
397
+ try:
398
+ converter.convert()
399
+ finally:
400
+ profiler.disable()
401
+ profiler.dump_stats(options.profiling_output_file)
402
+ else:
403
+ converter.convert()
359
404
  if converter.has_failed_acquisitions:
360
405
  return 1
@@ -150,8 +150,7 @@ def main(argv):
150
150
  "--darks-at-end",
151
151
  "--darks-end",
152
152
  default=None,
153
- help="url to the dataset containing darks to be store at"
154
- "the end." + _INFO_URL,
153
+ help="url to the dataset containing darks to be store atthe end." + _INFO_URL,
155
154
  )
156
155
  parser.add_argument(
157
156
  "--flats-at-start",
@@ -180,8 +179,7 @@ def main(argv):
180
179
  "--update-to-projection",
181
180
  "--update-to-proj",
182
181
  default=None,
183
- help="Define the set of frames to be mark as projection. "
184
- "" + _INFO_FRAME_INPUT,
182
+ help="Define the set of frames to be mark as projection. " + _INFO_FRAME_INPUT,
185
183
  )
186
184
  parser.add_argument(
187
185
  "--update-to-dark",
@@ -196,8 +194,7 @@ def main(argv):
196
194
  parser.add_argument(
197
195
  "--update-to-alignment",
198
196
  default=None,
199
- help="Define the set of frames to be mark as alignment. "
200
- "" + _INFO_FRAME_INPUT,
197
+ help="Define the set of frames to be mark as alignment. " + _INFO_FRAME_INPUT,
201
198
  )
202
199
  parser.add_argument(
203
200
  "--embed-data",
@@ -33,9 +33,9 @@ def test_blissfluo2nx_application_all_dets():
33
33
  )
34
34
  assert os.path.exists(output_file), "output_file doesn't exists"
35
35
  with h5py.File(output_file, "r") as f_test, h5py.File(truth_file, "r") as f_true:
36
- assert len(list(f_test.keys())) == len(
37
- list(f_true.keys())
38
- ), f"Number of entries ({len(list(f_test.keys()))}) not as expected ({len(list(f_true.keys()))})."
36
+ assert len(list(f_test.keys())) == len(list(f_true.keys())), (
37
+ f"Number of entries ({len(list(f_test.keys()))}) not as expected ({len(list(f_true.keys()))})."
38
+ )
39
39
  assert np.allclose(
40
40
  f_test["/grid_Ardesia_ng_mm2_Al_K/data/data"][()],
41
41
  f_true["/grid_Ardesia_ng_mm2_Al_K/data/data"][()],
@@ -65,9 +65,9 @@ def test_blissfluo2nx_application_single_det():
65
65
  )
66
66
  assert os.path.exists(output_file), "output_file doesn't exists"
67
67
  with h5py.File(output_file, "r") as f_test, h5py.File(truth_file, "r") as f_true:
68
- assert len(list(f_test.keys())) == len(
69
- list(f_true.keys())
70
- ), f"Number of entries ({len(list(f_test.keys()))}) not as expected ({len(list(f_true.keys()))})."
68
+ assert len(list(f_test.keys())) == len(list(f_true.keys())), (
69
+ f"Number of entries ({len(list(f_test.keys()))}) not as expected ({len(list(f_true.keys()))})."
70
+ )
71
71
  assert np.allclose(
72
72
  f_test["/grid_Ardesia_ng_mm2_Al_K/data/data"][()],
73
73
  f_true["/grid_Ardesia_ng_mm2_Al_K/data/data"][()],
@@ -98,9 +98,9 @@ def test_blissfluo2nx_application_two_det():
98
98
  )
99
99
  assert os.path.exists(output_file), "output_file doesn't exists"
100
100
  with h5py.File(output_file, "r") as f_test, h5py.File(truth_file, "r") as f_true:
101
- assert len(list(f_test.keys())) == len(
102
- list(f_true.keys())
103
- ), f"Number of entries ({len(list(f_test.keys()))}) not as expected ({len(list(f_true.keys()))})."
101
+ assert len(list(f_test.keys())) == len(list(f_true.keys())), (
102
+ f"Number of entries ({len(list(f_test.keys()))}) not as expected ({len(list(f_true.keys()))})."
103
+ )
104
104
  assert np.allclose(
105
105
  f_test["/grid_Ardesia_ng_mm2_Al_K/data/data"][()],
106
106
  f_true["/grid_Ardesia_ng_mm2_Al_K/data/data"][()],
@@ -20,9 +20,9 @@ def test_fluo2nx_application_all_dets(tmp_path):
20
20
  main(["fluo2nx", scan_dir, output_file, "CP1_XRD_insitu_top_ft_100nm"])
21
21
  assert os.path.exists(output_file), "output_file doesn't exists"
22
22
  with h5py.File(output_file, "r") as f:
23
- assert (
24
- len(list(f.keys())) == 45
25
- ), f"Number of entries ({len(list(f.keys()))}) not as expected (45)."
23
+ assert len(list(f.keys())) == 45, (
24
+ f"Number of entries ({len(list(f.keys()))}) not as expected (45)."
25
+ )
26
26
 
27
27
 
28
28
  def test_fluo2nx_application_single_det(tmp_path):
@@ -43,9 +43,9 @@ def test_fluo2nx_application_single_det(tmp_path):
43
43
  )
44
44
  assert os.path.exists(output_file), "output_file doesn't exists"
45
45
  with h5py.File(output_file, "r") as f:
46
- assert (
47
- len(list(f.keys())) == 15
48
- ), f"Number of entries ({len(list(f.keys()))}) not as expected (15)."
46
+ assert len(list(f.keys())) == 15, (
47
+ f"Number of entries ({len(list(f.keys()))}) not as expected (15)."
48
+ )
49
49
 
50
50
 
51
51
  def test_fluo2nx_application_two_dets(tmp_path):
@@ -67,9 +67,9 @@ def test_fluo2nx_application_two_dets(tmp_path):
67
67
  )
68
68
  assert os.path.exists(output_file), "output_file doesn't exists"
69
69
  with h5py.File(output_file, "r") as f:
70
- assert (
71
- len(list(f.keys())) == 30
72
- ), f"Number of entries ({len(list(f.keys()))}) not as expected (30)."
70
+ assert len(list(f.keys())) == 30, (
71
+ f"Number of entries ({len(list(f.keys()))}) not as expected (30)."
72
+ )
73
73
 
74
74
 
75
75
  def test_fluo2nx_application_2D(tmp_path):
@@ -89,9 +89,9 @@ def test_fluo2nx_application_2D(tmp_path):
89
89
  )
90
90
  assert os.path.exists(output_file), "output_file doesn't exists"
91
91
  with h5py.File(output_file, "r") as f:
92
- assert (
93
- len(list(f.keys())) == 4
94
- ), f"Number of entries ({len(list(f.keys()))}) not as expected (4)."
92
+ assert len(list(f.keys())) == 4, (
93
+ f"Number of entries ({len(list(f.keys()))}) not as expected (4)."
94
+ )
95
95
 
96
96
 
97
97
  def test_fluo2nx_application_2D_single_det(tmp_path):
@@ -114,6 +114,6 @@ def test_fluo2nx_application_2D_single_det(tmp_path):
114
114
  )
115
115
  assert os.path.exists(output_file), "output_file doesn't exists"
116
116
  with h5py.File(output_file, "r") as f:
117
- assert (
118
- len(list(f.keys())) == 2
119
- ), f"Number of entries ({len(list(f.keys()))}) not as expected (2)."
117
+ assert len(list(f.keys())) == 2, (
118
+ f"Number of entries ({len(list(f.keys()))}) not as expected (2)."
119
+ )
@@ -30,11 +30,13 @@ def str2bool(v):
30
30
 
31
31
 
32
32
  def get_arguments(user_args):
33
- parser = argparse.ArgumentParser(description="""
33
+ parser = argparse.ArgumentParser(
34
+ description="""
34
35
  creates all the target nxs for all the stages.
35
36
  If the postfixes for reference scans are give (the one before and another after the measurements) the reduced flats dark are also created.
36
37
  The references scans are expected to contains projections to be 'interpreted' as flats
37
- """)
38
+ """
39
+ )
38
40
  parser.add_argument(
39
41
  "--filename_template",
40
42
  required=False,
@@ -325,7 +325,7 @@ class _DxFileToNxConverter(BaseConverter):
325
325
  except Exception:
326
326
  self._configuration.energy = self.DEFAULT_BEAM_ENERGY
327
327
  _logger.warning(
328
- "No energy found or provided. " "Set the it to the default value"
328
+ "No energy found or provided. Set the it to the default value"
329
329
  )
330
330
 
331
331
  with HDF5File(self.output_file, mode="a") as h5f:
@@ -422,12 +422,12 @@ class _DxFileToNxConverter(BaseConverter):
422
422
  data_proj = get_data(self._data_proj_url)
423
423
  image_key.extend([ImageKey.PROJECTION.value] * len(data_proj))
424
424
  image_key_control.extend([ImageKey.PROJECTION.value] * len(data_proj))
425
- assert (
426
- self.scan_range[0] is not None
427
- ), "scan range is expected to be a tuple of float"
428
- assert (
429
- self.scan_range[1] is not None
430
- ), "scan range is expected to be a tuple of float"
425
+ assert self.scan_range[0] is not None, (
426
+ "scan range is expected to be a tuple of float"
427
+ )
428
+ assert self.scan_range[1] is not None, (
429
+ "scan range is expected to be a tuple of float"
430
+ )
431
431
  rotation_angle.extend(
432
432
  numpy.linspace(
433
433
  self.scan_range[0],
@@ -1080,9 +1080,9 @@ def __process(
1080
1080
 
1081
1081
  if configuration.delete_edf_source_files:
1082
1082
  print("start edf source files removal")
1083
- assert (
1084
- configuration.duplicate_data
1085
- ), "if data is not duplicated this make no sense to remove the edf files"
1083
+ assert configuration.duplicate_data, (
1084
+ "if data is not duplicated this make no sense to remove the edf files"
1085
+ )
1086
1086
  for file_path, (n_frames, used_urls) in edf_source_files.items():
1087
1087
  if n_frames > len(used_urls):
1088
1088
  _logger.warning(
@@ -85,9 +85,9 @@ def test_edf_to_nx_converter(
85
85
  with cwd_context(output_file):
86
86
  with HDF5File(output_file, mode="r") as h5f:
87
87
  detector_data_path = f"/{nx_entry}/instrument/detector/data"
88
- assert (
89
- f"/{nx_entry}/instrument/detector/data" in h5f
90
- ), f"/{nx_entry}/instrument/detector/data doesn't exists"
88
+ assert f"/{nx_entry}/instrument/detector/data" in h5f, (
89
+ f"/{nx_entry}/instrument/detector/data doesn't exists"
90
+ )
91
91
  assert h5f[detector_data_path].is_virtual == (not duplicate_data)
92
92
  assert (
93
93
  h5f[detector_data_path][()].min() != h5f[detector_data_path][()].max()
@@ -356,7 +356,6 @@ class FluoTomoScan2D(FluoTomoScanBase):
356
356
  slice_iterator = range(len(self.detected_folders))
357
357
 
358
358
  for ii_i in slice_iterator:
359
-
360
359
  proj_dir = os.path.join(
361
360
  self.scan,
362
361
  "fluofit",
@@ -31,7 +31,9 @@ class TestFluo2D:
31
31
  ), f"Number of elements found should be 2 and is {len(self.scan.el_lines)}." # pylint: disable=E1101
32
32
  assert set(self.scan.detectors) == set( # pylint: disable=E1101
33
33
  ["fluo1", "corrweighted"]
34
- ), f"There should be 2 'detectors' (fluo1 and corrweighted), {len(self.detectors)} were found." # pylint: disable=E1101
34
+ ), (
35
+ f"There should be 2 'detectors' (fluo1 and corrweighted), {len(self.detectors)} were found."
36
+ ) # pylint: disable=E1101
35
37
 
36
38
  def test_one_detector(self):
37
39
  scan = FluoTomoScan2D(
@@ -39,12 +41,12 @@ class TestFluo2D:
39
41
  dataset_basename=self.dataset_basename, # pylint: disable=E1101
40
42
  detectors=("corrweighted",),
41
43
  )
42
- assert (
43
- len(scan.el_lines) == 2
44
- ), f"Number of elements found should be 2 and is {len(scan.el_lines)}."
45
- assert (
46
- len(scan.detectors) == 1
47
- ), f"There should be 1 detector (corrweighted), {len(scan.detectors)} were found."
44
+ assert len(scan.el_lines) == 2, (
45
+ f"Number of elements found should be 2 and is {len(scan.el_lines)}."
46
+ )
47
+ assert len(scan.detectors) == 1, (
48
+ f"There should be 1 detector (corrweighted), {len(scan.detectors)} were found."
49
+ )
48
50
 
49
51
  # One ghost detector (no corresponding files)
50
52
  # test general section setters
@@ -62,5 +64,7 @@ class TestFluo2D:
62
64
  def test_load_energy_and_pixel_size(self):
63
65
  assert self.scan.energy == 17.1 # pylint: disable=E1101
64
66
  assert numpy.allclose(
65
- self.scan.pixel_size, 6e-10, atol=1e-4 # pylint: disable=E1101
67
+ self.scan.pixel_size,
68
+ 6e-10,
69
+ atol=1e-4, # pylint: disable=E1101
66
70
  ) # Tolerance:0.1nm (since pixel_size is expected in um).
@@ -30,7 +30,9 @@ class TestFluo3D:
30
30
  ), f"Number of elements found should be 14 and is {len(self.scan.el_lines)}." # pylint: disable=E1101
31
31
  assert set(self.scan.detectors) == set( # pylint: disable=E1101
32
32
  ["falcon", "weighted", "xmap"]
33
- ), f"There should be 3 'detectors' (xmap, falcon and weighted), {len(self.detectors)} were found." # pylint: disable=E1101
33
+ ), (
34
+ f"There should be 3 'detectors' (xmap, falcon and weighted), {len(self.detectors)} were found."
35
+ ) # pylint: disable=E1101
34
36
 
35
37
  def test_one_detector(self):
36
38
  scan = FluoTomoScan3D(
@@ -38,12 +40,12 @@ class TestFluo3D:
38
40
  dataset_basename=self.dataset_basename, # pylint: disable=E1101
39
41
  detectors=("xmap",),
40
42
  )
41
- assert (
42
- len(scan.el_lines) == 14
43
- ), f"Number of elements found should be 14 and is {len(scan.el_lines)}."
44
- assert (
45
- len(scan.detectors) == 1
46
- ), f"There should be 1 detector (xmap), {len(scan.detectors)} were found."
43
+ assert len(scan.el_lines) == 14, (
44
+ f"Number of elements found should be 14 and is {len(scan.el_lines)}."
45
+ )
46
+ assert len(scan.detectors) == 1, (
47
+ f"There should be 1 detector (xmap), {len(scan.detectors)} were found."
48
+ )
47
49
 
48
50
  # One ghost detector (no corresponding files)
49
51
  # test general section setters
@@ -128,7 +128,7 @@ def from_fscan_to_nx(
128
128
  my_nxtomo.instrument.detector.half_acquisition = halftomo and do_360
129
129
  my_nxtomo.instrument.detector.x_pixel_size = (
130
130
  my_nxtomo.instrument.detector.y_pixel_size
131
- ) = (6.5 * 1e-6)
131
+ ) = 6.5 * 1e-6
132
132
 
133
133
  n_frames = len(my_nxtomo.sample.rotation_angle)
134
134
  my_nxtomo.instrument.detector.sequence_number = np.linspace(