Skip to main content

Generic loaders for ESRF useful files

Project description

esrf-loadfile

GitLab Repo

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

esrf_loadfile-0.2.2.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

esrf_loadfile-0.2.2-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

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

Hashes for esrf_loadfile-0.2.2.tar.gz
Algorithm Hash digest
SHA256 672c39e7c423b2b2495f3e4afda7c378e3eac8b9cfd8ffdccd4344f7a4ced150
MD5 cc3de833de148bac42ae687b03fde339
BLAKE2b-256 f825a1035cbf06eefec18d3c83a723d75e1f63ec56d5b2984cd38f7876d37e42

See more details on using hashes here.

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

Hashes for esrf_loadfile-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e18294bac5d403ce9c92942117d600f2a9ffaa50ce7877fb27f02a9ea26569ac
MD5 5a6f43841a7ea3c4bc9ae257e0a8d22e
BLAKE2b-256 3e9abde8df9c1e3900d2d10962c5dcf5e1fc5671446ea0603bf8e6e02718b15d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page