diff --git a/pyproject.toml b/pyproject.toml index a5fc772..46a165f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ dependencies = [ "scippneutron>=24.12.0", "scippnexus>=23.11.1", "tifffile>=2024.7.2", - "essreduce>=25.07.0", + "essreduce>=25.10.0", "scitiff>=25.7", ] diff --git a/requirements/base.in b/requirements/base.in index 036dec7..13d24d5 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -10,5 +10,5 @@ scipp>=25.4.0 scippneutron>=24.12.0 scippnexus>=23.11.1 tifffile>=2024.7.2 -essreduce>=25.07.0 +essreduce>=25.10.0 scitiff>=25.7 diff --git a/requirements/base.txt b/requirements/base.txt index b7721db..32901a4 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,4 +1,4 @@ -# SHA1:4f74551f1e88f1fbd5aa6d076972705f7d55e8be +# SHA1:753ad79f56410b37320aff70f9bfd2977ec31d52 # # This file was generated by pip-compile-multi. # To update, run: @@ -9,11 +9,11 @@ annotated-types==0.7.0 # via pydantic asttokens==3.0.0 # via stack-data -attrs==25.3.0 +attrs==25.4.0 # via # jsonschema # referencing -click==8.2.1 +click==8.3.0 # via dask cloudpickle==3.1.1 # via dask @@ -25,7 +25,7 @@ cyclebane==24.10.0 # via sciline cycler==0.12.1 # via matplotlib -dask==2025.9.0 +dask==2025.9.1 # via -r base.in decorator==5.2.1 # via ipython @@ -33,11 +33,11 @@ dnspython==2.8.0 # via email-validator email-validator==2.3.0 # via scippneutron -essreduce==25.9.0 +essreduce==25.10.0 # via -r base.in executing==2.2.1 # via stack-data -fonttools==4.59.2 +fonttools==4.60.1 # via matplotlib fsspec==2025.9.0 # via dask @@ -55,9 +55,9 @@ importlib-metadata==8.7.0 # via dask ipydatawidgets==4.3.5 # via pythreejs -ipympl==0.9.7 +ipympl==0.9.8 # via plopp -ipython==9.5.0 +ipython==9.6.0 # via # ipympl # ipywidgets @@ -85,7 +85,7 @@ lazy-loader==0.4 # scippneutron locket==1.0.0 # via partd -matplotlib==3.10.6 +matplotlib==3.10.7 # via # ipympl # mpltoolbox @@ -125,7 +125,7 @@ pillow==11.3.0 # via # ipympl # matplotlib -plopp[all]==25.7.1 +plopp[all]==25.10.0 # via # -r base.in # scippneutron @@ -135,17 +135,17 @@ ptyprocess==0.7.0 # via pexpect pure-eval==0.2.3 # via stack-data -pydantic==2.11.9 +pydantic==2.12.0 # via # scippneutron # scitiff -pydantic-core==2.33.2 +pydantic-core==2.41.1 # via pydantic pygments==2.19.2 # via # ipython # ipython-pygments-lexers -pyparsing==3.2.4 +pyparsing==3.2.5 # via matplotlib python-dateutil==2.9.0.post0 # via @@ -154,7 +154,7 @@ python-dateutil==2.9.0.post0 # scippnexus pythreejs==2.4.2 # via plopp -pyyaml==6.0.2 +pyyaml==6.0.3 # via dask referencing==0.36.2 # via @@ -195,7 +195,7 @@ six==1.17.0 # via python-dateutil stack-data==0.6.3 # via ipython -tifffile==2025.9.9 +tifffile==2025.10.4 # via # -r base.in # scitiff @@ -221,9 +221,9 @@ typing-extensions==4.15.0 # referencing # sciline # typing-inspection -typing-inspection==0.4.1 +typing-inspection==0.4.2 # via pydantic -wcwidth==0.2.13 +wcwidth==0.2.14 # via prompt-toolkit widgetsnbextension==4.0.14 # via ipywidgets diff --git a/requirements/basetest.txt b/requirements/basetest.txt index 8a280aa..de3c7e4 100644 --- a/requirements/basetest.txt +++ b/requirements/basetest.txt @@ -7,11 +7,11 @@ # annotated-types==0.7.0 # via pydantic -attrs==25.3.0 +attrs==25.4.0 # via # jsonschema # referencing -certifi==2025.8.3 +certifi==2025.10.5 # via requests charset-normalizer==3.4.3 # via requests @@ -19,7 +19,7 @@ contourpy==1.3.3 # via matplotlib cycler==0.12.1 # via matplotlib -fonttools==4.59.2 +fonttools==4.60.1 # via matplotlib idna==3.10 # via requests @@ -35,7 +35,7 @@ lazy-loader==0.4 # via # plopp # tof -matplotlib==3.10.6 +matplotlib==3.10.7 # via plopp numpy==2.3.3 # via @@ -52,21 +52,21 @@ packaging==25.0 # pytest pillow==11.3.0 # via matplotlib -platformdirs==4.4.0 +platformdirs==4.5.0 # via pooch -plopp==25.7.1 +plopp==25.10.0 # via tof pluggy==1.6.0 # via pytest pooch==1.8.2 # via -r basetest.in -pydantic==2.11.9 +pydantic==2.12.0 # via scitiff -pydantic-core==2.33.2 +pydantic-core==2.41.1 # via pydantic pygments==2.19.2 # via pytest -pyparsing==3.2.4 +pyparsing==3.2.5 # via matplotlib pytest==8.4.2 # via -r basetest.in @@ -92,9 +92,9 @@ scitiff==25.7.0 # via -r basetest.in six==1.17.0 # via python-dateutil -tifffile==2025.9.9 +tifffile==2025.10.4 # via scitiff -tof==25.8.0 +tof==25.10.0 # via -r basetest.in typing-extensions==4.15.0 # via @@ -102,7 +102,7 @@ typing-extensions==4.15.0 # pydantic-core # referencing # typing-inspection -typing-inspection==0.4.1 +typing-inspection==0.4.2 # via pydantic urllib3==2.5.0 # via requests diff --git a/requirements/ci.txt b/requirements/ci.txt index 860759c..a0690b8 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -7,7 +7,7 @@ # cachetools==6.2.0 # via tox -certifi==2025.8.3 +certifi==2025.10.5 # via requests chardet==5.2.0 # via tox @@ -17,7 +17,7 @@ colorama==0.4.6 # via tox distlib==0.4.0 # via virtualenv -filelock==3.19.1 +filelock==3.20.0 # via # tox # virtualenv @@ -32,21 +32,21 @@ packaging==25.0 # -r ci.in # pyproject-api # tox -platformdirs==4.4.0 +platformdirs==4.5.0 # via # tox # virtualenv pluggy==1.6.0 # via tox -pyproject-api==1.9.1 +pyproject-api==1.10.0 # via tox requests==2.32.5 # via -r ci.in smmap==5.0.2 # via gitdb -tox==4.30.2 +tox==4.31.0 # via -r ci.in urllib3==2.5.0 # via requests -virtualenv==20.34.0 +virtualenv==20.35.1 # via tox diff --git a/requirements/dev.txt b/requirements/dev.txt index b85d233..51ec3d5 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -12,7 +12,7 @@ -r static.txt -r test.txt -r wheels.txt -anyio==4.10.0 +anyio==4.11.0 # via # httpx # jupyter-server @@ -66,27 +66,27 @@ jupyter-server==2.17.0 # notebook-shim jupyter-server-terminals==0.5.3 # via jupyter-server -jupyterlab==4.4.7 +jupyterlab==4.4.9 # via -r dev.in jupyterlab-server==2.27.3 # via jupyterlab -lark==1.2.2 +lark==1.3.0 # via rfc3987-syntax notebook-shim==0.2.4 # via jupyterlab overrides==7.7.0 # via jupyter-server -pip-compile-multi==3.2.1 +pip-compile-multi==3.2.2 # via -r dev.in -pip-tools==7.5.0 +pip-tools==7.5.1 # via pip-compile-multi plumbum==1.9.0 # via copier -prometheus-client==0.22.1 +prometheus-client==0.23.1 # via jupyter-server pycparser==2.23 # via cffi -python-json-logger==3.3.0 +python-json-logger==4.0.0 # via jupyter-events questionary==2.1.1 # via copier @@ -110,13 +110,13 @@ terminado==0.18.1 # jupyter-server-terminals toposort==1.10 # via pip-compile-multi -types-python-dateutil==2.9.0.20250822 +types-python-dateutil==2.9.0.20251008 # via arrow uri-template==1.3.0 # via jsonschema webcolors==24.11.1 # via jsonschema -websocket-client==1.8.0 +websocket-client==1.9.0 # via jupyter-server wheel==0.45.1 # via pip-tools diff --git a/requirements/docs.txt b/requirements/docs.txt index da8f24b..a78f226 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -16,17 +16,17 @@ babel==2.17.0 # via # pydata-sphinx-theme # sphinx -beautifulsoup4==4.13.5 +beautifulsoup4==4.14.2 # via # nbconvert # pydata-sphinx-theme bleach[css]==6.2.0 # via nbconvert -certifi==2025.8.3 +certifi==2025.10.5 # via requests charset-normalizer==3.4.3 # via requests -debugpy==1.8.16 +debugpy==1.8.17 # via ipykernel defusedxml==0.7.1 # via nbconvert @@ -65,7 +65,7 @@ markdown-it-py==3.0.0 # via # mdit-py-plugins # myst-parser -markupsafe==3.0.2 +markupsafe==3.0.3 # via # jinja2 # nbconvert @@ -92,15 +92,15 @@ nest-asyncio==1.6.0 # via ipykernel pandocfilters==1.5.1 # via nbconvert -platformdirs==4.4.0 +platformdirs==4.5.0 # via # jupyter-core # pooch pooch==1.8.2 # via -r docs.in -psutil==7.0.0 +psutil==7.1.0 # via ipykernel -pydantic-settings==2.10.1 +pydantic-settings==2.11.0 # via autodoc-pydantic pydata-sphinx-theme==0.16.1 # via -r docs.in @@ -148,7 +148,7 @@ sphinxcontrib-serializinghtml==2.0.0 # via sphinx tinycss2==1.4.0 # via bleach -tof==25.8.0 +tof==25.10.0 # via -r docs.in tornado==6.5.2 # via diff --git a/requirements/mypy.txt b/requirements/mypy.txt index d2ed351..088d0c2 100644 --- a/requirements/mypy.txt +++ b/requirements/mypy.txt @@ -6,7 +6,7 @@ # requirements upgrade # -r test.txt -mypy==1.18.1 +mypy==1.18.2 # via -r mypy.in mypy-extensions==1.1.0 # via mypy diff --git a/requirements/nightly.txt b/requirements/nightly.txt index 21203ad..f6adf35 100644 --- a/requirements/nightly.txt +++ b/requirements/nightly.txt @@ -10,15 +10,15 @@ annotated-types==0.7.0 # via pydantic -attrs==25.3.0 +attrs==25.4.0 # via # jsonschema # referencing -certifi==2025.8.3 +certifi==2025.10.5 # via requests charset-normalizer==3.4.3 # via requests -click==8.2.1 +click==8.3.0 # via dask cloudpickle==3.1.1 # via dask @@ -28,7 +28,7 @@ cyclebane==24.10.0 # via sciline cycler==0.12.1 # via matplotlib -dask==2025.9.0 +dask==2025.9.1 # via -r nightly.in dnspython==2.8.0 # via email-validator @@ -36,7 +36,7 @@ email-validator==2.3.0 # via scippneutron essreduce @ git+https://github.com/scipp/essreduce@main # via -r nightly.in -fonttools==4.59.2 +fonttools==4.60.1 # via matplotlib fsspec==2025.9.0 # via dask @@ -67,7 +67,7 @@ lazy-loader==0.4 # tof locket==1.0.0 # via partd -matplotlib==3.10.6 +matplotlib==3.10.7 # via # mpltoolbox # plopp @@ -95,7 +95,7 @@ partd==1.4.2 # via dask pillow==11.3.0 # via matplotlib -platformdirs==4.4.0 +platformdirs==4.5.0 # via pooch plopp @ git+https://github.com/scipp/plopp@main # via @@ -106,15 +106,15 @@ pluggy==1.6.0 # via pytest pooch==1.8.2 # via -r nightly.in -pydantic==2.12.0a1 +pydantic==2.12.0 # via # scippneutron # scitiff -pydantic-core==2.37.2 +pydantic-core==2.41.1 # via pydantic pygments==2.19.2 # via pytest -pyparsing==3.2.4 +pyparsing==3.3.0a1 # via matplotlib pytest==8.4.2 # via -r nightly.in @@ -122,7 +122,7 @@ python-dateutil==2.9.0.post0 # via # matplotlib # scippneutron -pyyaml==6.0.2 +pyyaml==6.0.3 # via dask referencing==0.36.2 # via @@ -164,7 +164,7 @@ scitiff==25.7.0 # via -r nightly.in six==1.17.0 # via python-dateutil -tifffile==2025.9.9 +tifffile==2025.10.4 # via # -r nightly.in # scitiff @@ -181,7 +181,7 @@ typing-extensions==4.15.0 # referencing # sciline # typing-inspection -typing-inspection==0.4.1 +typing-inspection==0.4.2 # via pydantic urllib3==2.5.0 # via requests diff --git a/requirements/static.txt b/requirements/static.txt index 14b87b1..34ee4ba 100644 --- a/requirements/static.txt +++ b/requirements/static.txt @@ -9,17 +9,17 @@ cfgv==3.4.0 # via pre-commit distlib==0.4.0 # via virtualenv -filelock==3.19.1 +filelock==3.20.0 # via virtualenv -identify==2.6.14 +identify==2.6.15 # via pre-commit nodeenv==1.9.1 # via pre-commit -platformdirs==4.4.0 +platformdirs==4.5.0 # via virtualenv pre-commit==4.3.0 # via -r static.in -pyyaml==6.0.2 +pyyaml==6.0.3 # via pre-commit -virtualenv==20.34.0 +virtualenv==20.35.1 # via pre-commit diff --git a/src/ess/imaging/data.py b/src/ess/imaging/data.py index ee02f99..71a0c96 100644 --- a/src/ess/imaging/data.py +++ b/src/ess/imaging/data.py @@ -2,51 +2,10 @@ # Copyright (c) 2024 Scipp contributors (https://github.com/scipp) import pathlib +from ess.reduce.data import make_registry -class Registry: - def __init__( - self, - instrument: str, - files: dict[str, str], - version: str, - retry_if_failed: int = 3, - ): - import pooch - - self._registry = pooch.create( - path=pooch.os_cache(f'ess/{instrument}'), - env=f'ESS_{instrument.upper()}_DATA_DIR', - base_url=f'https://public.esss.dk/groups/scipp/ess/{instrument}/{version}/', - version=version, - retry_if_failed=retry_if_failed, - registry=files, - ) - - def __contains__(self, key): - return key in self._registry.registry - - def __call__(self, name: str, unzip: bool = False) -> pathlib.Path: - """ - Get the path to a file in the registry. - - Parameters - ---------- - name: - Name of the file to get the path for. - unzip: - If `True`, unzip the file before returning the path. - """ - import pooch - - if unzip: - path = self._registry.fetch(name, processor=pooch.Unzip())[0] - else: - path = self._registry.fetch(name) - return pathlib.Path(path) - - -_registry = Registry( - instrument='imaging', +_registry = make_registry( + 'ess/imaging', version="1", files={ 'siemens_star.tiff': 'md5:0ba27c2daf745338959f5156a3b0a2c0', @@ -63,7 +22,7 @@ def siemens_star_path() -> pathlib.Path: Return the path to the Siemens star test image. """ - return _registry('siemens_star.tiff') + return _registry.get_path('siemens_star.tiff') def resolving_power_test_target_path() -> pathlib.Path: @@ -71,7 +30,7 @@ def resolving_power_test_target_path() -> pathlib.Path: Return the path to the resolving power test target image. """ - return _registry('resolving_power_test_target.tiff') + return _registry.get_path('resolving_power_test_target.tiff') def jparc_siemens_star_measured_path() -> pathlib.Path: @@ -79,7 +38,7 @@ def jparc_siemens_star_measured_path() -> pathlib.Path: Return the path to the Siemens star test image measured at J-PARC. """ - return _registry('siemens-star-measured.h5') + return _registry.get_path('siemens-star-measured.h5') def jparc_siemens_star_openbeam_path() -> pathlib.Path: @@ -87,4 +46,4 @@ def jparc_siemens_star_openbeam_path() -> pathlib.Path: Return the path to the Siemens star open beam image measured at J-PARC. """ - return _registry('siemens-star-openbeam.h5') + return _registry.get_path('siemens-star-openbeam.h5') diff --git a/src/ess/odin/data.py b/src/ess/odin/data.py index a8df80d..359b74c 100644 --- a/src/ess/odin/data.py +++ b/src/ess/odin/data.py @@ -4,10 +4,10 @@ import pathlib -from ..imaging.data import Registry +from ess.reduce.data import make_registry -_registry = Registry( - instrument='odin', +_registry = make_registry( + 'ess/odin', version="1", files={ "iron_simulation_ob_large.nxs": "md5:a93517ea2aa167d134ca63671f663f99", @@ -26,7 +26,7 @@ def iron_simulation_sample_small() -> pathlib.Path: The file was generated with the ``tools/mcstas_to_nexus.ipynb`` notebook, sampling 1M events from the McStas results. """ - return _registry("iron_simulation_sample_small.nxs") + return _registry.get_path("iron_simulation_sample_small.nxs") def iron_simulation_ob_small() -> pathlib.Path: @@ -36,7 +36,7 @@ def iron_simulation_ob_small() -> pathlib.Path: The file was generated with the ``tools/mcstas_to_nexus.ipynb`` notebook, sampling 1M events from the McStas results. """ - return _registry("iron_simulation_ob_small.nxs") + return _registry.get_path("iron_simulation_ob_small.nxs") def iron_simulation_sample_large() -> pathlib.Path: @@ -46,7 +46,7 @@ def iron_simulation_sample_large() -> pathlib.Path: The file was generated with the ``tools/mcstas_to_nexus.ipynb`` notebook, sampling 10M events from the McStas results. """ - return _registry("iron_simulation_sample_large.nxs") + return _registry.get_path("iron_simulation_sample_large.nxs") def iron_simulation_ob_large() -> pathlib.Path: @@ -56,7 +56,7 @@ def iron_simulation_ob_large() -> pathlib.Path: The file was generated with the ``tools/mcstas_to_nexus.ipynb`` notebook, sampling 10M events from the McStas results. """ - return _registry("iron_simulation_ob_large.nxs") + return _registry.get_path("iron_simulation_ob_large.nxs") def odin_tof_lookup_table() -> pathlib.Path: @@ -68,4 +68,4 @@ def odin_tof_lookup_table() -> pathlib.Path: <../../user-guide/odin/odin-make-tof-lookup-table.rst>`_ with ``NumberOfSimulatedNeutrons = 5_000_000``. """ - return _registry("ODIN-tof-lookup-table.h5") + return _registry.get_path("ODIN-tof-lookup-table.h5") diff --git a/src/ess/tbl/data.py b/src/ess/tbl/data.py index 7c70e2d..6d8a683 100644 --- a/src/ess/tbl/data.py +++ b/src/ess/tbl/data.py @@ -4,22 +4,24 @@ import pathlib -from ..imaging.data import Registry +from ess.reduce.data import Entry, make_registry -_registry = Registry( - instrument='tbl', +_registry = make_registry( + 'ess/tbl', version="1", files={ "tbl_sample_data_2025-03.hdf": "md5:12db6bc06721278b3abe47992eac3e77", "TBL-tof-lookup-table-no-choppers.h5": "md5:8bc98fac0ee64fc8f5decf509c75bafe", - 'tbl-orca-focussing.hdf.zip': 'md5:f365acd9ea45dd205c0b9398d163cfa4', + 'tbl-orca-focussing.hdf.zip': Entry( + alg='md5', chk='f365acd9ea45dd205c0b9398d163cfa4', unzip=True + ), }, ) def tutorial_sample_data() -> pathlib.Path: """ """ - return _registry("tbl_sample_data_2025-03.hdf") + return _registry.get_path("tbl_sample_data_2025-03.hdf") def tbl_tof_lookup_table_no_choppers() -> pathlib.Path: @@ -31,7 +33,7 @@ def tbl_tof_lookup_table_no_choppers() -> pathlib.Path: <../../user-guide/tbl/tbl-make-tof-lookup-table.rst>`_ with ``NumberOfSimulatedNeutrons = 2_000_000``. """ - return _registry("TBL-tof-lookup-table-no-choppers.h5") + return _registry.get_path("TBL-tof-lookup-table-no-choppers.h5") def tbl_orca_focussing_data() -> pathlib.Path: @@ -41,4 +43,4 @@ def tbl_orca_focussing_data() -> pathlib.Path: to reduce the file size. """ - return _registry('tbl-orca-focussing.hdf.zip', unzip=True) + return _registry.get_path('tbl-orca-focussing.hdf.zip') diff --git a/src/ess/ymir/data.py b/src/ess/ymir/data.py index 5946075..160a8e4 100644 --- a/src/ess/ymir/data.py +++ b/src/ess/ymir/data.py @@ -2,10 +2,10 @@ # Copyright (c) 2024 Scipp contributors (https://github.com/scipp) import pathlib -from ..imaging.data import Registry +from ess.reduce.data import make_registry -_registry = Registry( - instrument='ymir', +_registry = make_registry( + 'ess/ymir', version="1", files={ 'small_ymir_images.hdf': 'md5:cf83695d5da29e686c10a31b402b8bdb', @@ -18,4 +18,4 @@ def ymir_lego_images_path() -> pathlib.Path: Return the path to the small YMIR images HDF5 file. """ - return _registry('small_ymir_images.hdf') + return _registry.get_path('small_ymir_images.hdf')