nabu 2024.2.11__py3-none-any.whl → 2024.2.12__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.
nabu/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "2024.2.11"
1
+ __version__ = "2024.2.12"
2
2
  __nabu_modules__ = [
3
3
  "app",
4
4
  "cuda",
nabu/io/cast_volume.py CHANGED
@@ -1,4 +1,6 @@
1
1
  import os
2
+
3
+ from tomoscan.esrf.volume.singleframebase import VolumeSingleFrameBase
2
4
  from nabu.misc.utils import rescale_data
3
5
  from nabu.pipeline.params import files_formats
4
6
  from tomoscan.volumebase import VolumeBase
@@ -176,6 +178,17 @@ def cast_volume(
176
178
  if not isinstance(output_data_type, numpy.dtype):
177
179
  raise TypeError(f"output_data_type is expected to be a {numpy.dtype}. {type(output_data_type)} provided")
178
180
 
181
+ # Make sure the output volume has the same "start_index" as input volume, if relevant
182
+ if isinstance(input_volume, VolumeSingleFrameBase) and isinstance(output_volume, VolumeSingleFrameBase):
183
+ try:
184
+ first_file_name = next(input_volume.browse_data_files())
185
+ start_idx = int(first_file_name.split(".")[0].split("_")[-1])
186
+ except (StopIteration, ValueError, TypeError):
187
+ # StopIteration: Input volume has no file - should not happen
188
+ # ValueError / TypeError: fail to convert to int, something wrong when extracting slice number (non-default file name scheme)
189
+ start_idx = 0
190
+ output_volume.start_index = start_idx
191
+
179
192
  # start processing
180
193
  # check for data_min and data_max
181
194
  if data_min is None or data_max is None:
@@ -0,0 +1,9 @@
1
+ from nabu.utils import list_match_queries
2
+
3
+
4
+ def test_list_match_queries():
5
+
6
+ # entry0000 .... entry0099
7
+ avail = ["entry%04d" % i for i in range(100)]
8
+ query = "entry0000"
9
+ list_match_queries()
@@ -1,31 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nabu
3
- Version: 2024.2.11
3
+ Version: 2024.2.12
4
4
  Summary: Nabu - Tomography software
5
5
  Author-email: Pierre Paleo <pierre.paleo@esrf.fr>, Henri Payno <henri.payno@esrf.fr>, Alessandro Mirone <mirone@esrf.fr>, Jérôme Lesaint <jerome.lesaint@esrf.fr>
6
6
  Maintainer-email: Pierre Paleo <pierre.paleo@esrf.fr>
7
- License: MIT License
8
-
9
- Copyright (c) 2020-2024 ESRF
10
-
11
- Permission is hereby granted, free of charge, to any person obtaining a copy
12
- of this software and associated documentation files (the "Software"), to deal
13
- in the Software without restriction, including without limitation the rights
14
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- copies of the Software, and to permit persons to whom the Software is
16
- furnished to do so, subject to the following conditions:
17
-
18
- The above copyright notice and this permission notice shall be included in all
19
- copies or substantial portions of the Software.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
- SOFTWARE.
28
-
7
+ License-Expression: MIT
29
8
  Project-URL: Homepage, https://gitlab.esrf.fr/tomotools/nabu
30
9
  Project-URL: Documentation, http://www.silx.org/pub/nabu/doc
31
10
  Project-URL: Repository, https://gitlab.esrf.fr/tomotools/nabu/-/releases
@@ -40,7 +19,6 @@ Classifier: Programming Language :: Python :: 3.8
40
19
  Classifier: Programming Language :: Python :: 3.9
41
20
  Classifier: Programming Language :: Python :: 3.10
42
21
  Classifier: Environment :: Console
43
- Classifier: License :: OSI Approved :: MIT License
44
22
  Classifier: Operating System :: Unix
45
23
  Classifier: Operating System :: MacOS :: MacOS X
46
24
  Classifier: Operating System :: POSIX
@@ -53,7 +31,7 @@ Requires-Dist: numpy<2,>1.9.0
53
31
  Requires-Dist: scipy
54
32
  Requires-Dist: h5py>=3.0
55
33
  Requires-Dist: silx>=0.15.0
56
- Requires-Dist: tomoscan>=2.1.0
34
+ Requires-Dist: tomoscan>=2.1.5
57
35
  Requires-Dist: psutil
58
36
  Requires-Dist: pytest
59
37
  Requires-Dist: tifffile
@@ -1,7 +1,7 @@
1
1
  doc/conf.py,sha256=3xtCarCHrXPr50GbeRDuH-o3Jzojw7mpr7vpGfZPLAE,3787
2
2
  doc/create_conf_doc.py,sha256=IVOdP70KvbW9WS_UQu3Iyd0YfS60E2fJ5IDtQ_s4cDw,1143
3
3
  doc/get_mathjax.py,sha256=VIvKRCdDuF2VoY8JD3mSey9XX13AZMmwTJBHdt1tUs4,1012
4
- nabu/__init__.py,sha256=pcf3vfOOGAWNkBnrtmOVzs63rfkJ3PfQoNhZsCBkDF0,271
4
+ nabu/__init__.py,sha256=YifF4GAurmjhWkdEHc0w9j48GNlcJSLObAKt0WNrcUo,271
5
5
  nabu/tests.py,sha256=cew9OY2uTyncHI_HM32W8CP6B1GTGKaOW65XtMEqs7o,1417
6
6
  nabu/testutils.py,sha256=VkSL9tbY0XEH49Z5OjDFFhzkSxrCv4UIuvSVFgegSUY,7632
7
7
  nabu/utils.py,sha256=V1B_sD54XGNKn5pORa2yNCATyswOzybey3sv8BuIYWY,26355
@@ -77,7 +77,7 @@ nabu/estimation/tests/test_focus.py,sha256=cMxEeTLlfVHOvG_4oGMLpp6bVI6okYz0u4aNc
77
77
  nabu/estimation/tests/test_tilt.py,sha256=PN4tnV3-XU2nNA608kQShaHugWn_-wbHzWCTnLIaCTk,1658
78
78
  nabu/estimation/tests/test_translation.py,sha256=RkOnCYgk9DZGKlIka1snqTv4wbIz_nG7-EHAxnBHsJU,2999
79
79
  nabu/io/__init__.py,sha256=AbQgj4-fCCHOKynO_PyAR9ejnFSuWKgroxxhxWVpjyQ,120
80
- nabu/io/cast_volume.py,sha256=gYsqHGdeiuTlOBCb9B7koRZ_bO0IQnN-XrzsSvR1s_I,16737
80
+ nabu/io/cast_volume.py,sha256=LQkd3I_W9mpX_vIa7iAV-rcv2ZcCJ-NZ3EQuFAPYJSI,17504
81
81
  nabu/io/detector_distortion.py,sha256=Or4icugi0fGRKWIG0I9hCuR1UZA5Cel25ZGY7cR2j4I,11744
82
82
  nabu/io/reader.py,sha256=McWg7w04zrI0mt2z-BBwUr7rryMWYjdg7aHqbNeZ45A,40518
83
83
  nabu/io/reader_helical.py,sha256=_6vZBH-US_VT7oOGJUtYXqPwFws7xZKcmdOthpwvlIQ,4477
@@ -262,6 +262,7 @@ nabu/resources/templates/id16_holo.conf,sha256=sDd_rEJGZjOGVAsGub5sT2arfXDnc_sxy
262
262
  nabu/resources/templates/id16a_fluo.conf,sha256=Nz1etzO2fSwksi7CThWJ5T1kZEdyBe8rMO7puNJ93Hc,542
263
263
  nabu/resources/templates/id19_pag.conf,sha256=u4fFPEBprzOW9_5_ChkIgowQcYpLhjmA8Gwm5XgC4Jc,384
264
264
  nabu/resources/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
265
+ nabu/resources/tests/test_extract.py,sha256=msYWFP96LjpEntq1ucTWgKZMhUvZcLpJ-AQB3oGOh2E,206
265
266
  nabu/resources/tests/test_nxflatfield.py,sha256=XRGbYwqJv0NYAVQnAB224TwTZP_W2Bs3-yu0zQnDzEM,4179
266
267
  nabu/resources/tests/test_units.py,sha256=F2jFTck-1UwYET1MwTtX6ntzYUosfwOJkugSencGgz8,2155
267
268
  nabu/stitching/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -309,9 +310,9 @@ nabu/thirdparty/pore3d_deringer_munch.py,sha256=o4bisnFc-wMjuohWBT8wgWmfNehPQGtC
309
310
  nabu/thirdparty/tomocupy_remove_stripe.py,sha256=Khe4zFf0kRzu65Yxnvq58gt1ljOztqJGdMDhVAiM7lM,24363
310
311
  nabu/thirdparty/tomopy_phase.py,sha256=hK4oPpkogLOhv23XzzEXQY2u3r8fJvASY_bINVs6ERE,8634
311
312
  nabu/thirdparty/tomwer_load_flats_darks.py,sha256=ZNoVAinUb_wGYbfvs_4BVnWsjsQmNxSvCh1bWhR2WWg,5611
312
- nabu-2024.2.11.dist-info/licenses/LICENSE,sha256=1eAIPSnEsnSFNUODnLtNtQTs76exG3ZxJ1DJR6zoUBA,1066
313
- nabu-2024.2.11.dist-info/METADATA,sha256=dsMISANCk2gHi-RZbdyIXTUkAbqsmMoQ3A_TXENN9nI,5537
314
- nabu-2024.2.11.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
315
- nabu-2024.2.11.dist-info/entry_points.txt,sha256=cJKGkBeykVL7uK3E4R0RLRqMXifTL2qdO573syPAvJc,1288
316
- nabu-2024.2.11.dist-info/top_level.txt,sha256=fsm_N3eXLRZk2QXF9OSKPNDPFXOz8FAQjHh5avT3dok,9
317
- nabu-2024.2.11.dist-info/RECORD,,
313
+ nabu-2024.2.12.dist-info/licenses/LICENSE,sha256=1eAIPSnEsnSFNUODnLtNtQTs76exG3ZxJ1DJR6zoUBA,1066
314
+ nabu-2024.2.12.dist-info/METADATA,sha256=js11kdh6t1G64wHG9VEC9Pjhxb2305HB5GrmmkkPSX0,4266
315
+ nabu-2024.2.12.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
316
+ nabu-2024.2.12.dist-info/entry_points.txt,sha256=cJKGkBeykVL7uK3E4R0RLRqMXifTL2qdO573syPAvJc,1288
317
+ nabu-2024.2.12.dist-info/top_level.txt,sha256=fsm_N3eXLRZk2QXF9OSKPNDPFXOz8FAQjHh5avT3dok,9
318
+ nabu-2024.2.12.dist-info/RECORD,,