Generic loaders for ESRF useful files
Project description
esrf-loadfile
Standalone re-usable loader utilities for ESRF DCT and tomography data formats.
These helpers were extracted from the StatusGUI code base so that other tools can
inspect .h5, .mat, .cif, and reflection files without depending on the GUI.
Installation
pip install esrf-loadfile
Mamba environment
module load mamba # on ESRF systems
mamba create -n esrf_loadfile -c conda-forge python pip setuptools
mamba activate esrf_loadfile
pip install esrf_loadfile
For local development inside the StatusGUI monorepo you can install it in editable mode:
pip install -e loadfile
Usage
from esrf_loadfile import loadFile
handler = loadFile("/path/to/parameters.h5")
print(handler.get_keys("entry/detector"))
# Nested keys work end-to-end:
dataset = handler.get_value("entry/detector/data")
print(handler.get_size("entry/detector/data"))
print(handler.get_description("entry/detector/data"))
# Inline dataset specs return the value directly:
dataset = loadFile("/path/to/parameters.h5::/entry/detector/data")
Inline specs are useful when you want a one-liner that returns the dataset directly.
Development
Install the project in editable mode together with its test dependencies and run the test-suite:
pip install -e .[test]
PYTHONPATH=src pytest
To run the code-coherency checks (imports/formatting/linting) install the dev extras and run Ruff on the sources:
pip install -e .[dev]
ruff check src tests
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file esrf_loadfile-0.2.2.tar.gz.
File metadata
- Download URL: esrf_loadfile-0.2.2.tar.gz
- Upload date:
- Size: 24.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
672c39e7c423b2b2495f3e4afda7c378e3eac8b9cfd8ffdccd4344f7a4ced150
|
|
| MD5 |
cc3de833de148bac42ae687b03fde339
|
|
| BLAKE2b-256 |
f825a1035cbf06eefec18d3c83a723d75e1f63ec56d5b2984cd38f7876d37e42
|
File details
Details for the file esrf_loadfile-0.2.2-py3-none-any.whl.
File metadata
- Download URL: esrf_loadfile-0.2.2-py3-none-any.whl
- Upload date:
- Size: 17.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e18294bac5d403ce9c92942117d600f2a9ffaa50ce7877fb27f02a9ea26569ac
|
|
| MD5 |
5a6f43841a7ea3c4bc9ae257e0a8d22e
|
|
| BLAKE2b-256 |
3e9abde8df9c1e3900d2d10962c5dcf5e1fc5671446ea0603bf8e6e02718b15d
|