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.3.tar.gz (25.5 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.3-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

Details for the file esrf_loadfile-0.2.3.tar.gz.

File metadata

  • Download URL: esrf_loadfile-0.2.3.tar.gz
  • Upload date:
  • Size: 25.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for esrf_loadfile-0.2.3.tar.gz
Algorithm Hash digest
SHA256 7d6ce890bce9af7b8f121c961fc424902d1faa81947496e835401164aec10674
MD5 551a97e0ac264d589c7726b52cf2909c
BLAKE2b-256 78fffc13840027735f8cf3e212a8f8be86988939676de66f563c385095dc67e5

See more details on using hashes here.

File details

Details for the file esrf_loadfile-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: esrf_loadfile-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 23.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for esrf_loadfile-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 24100c766b52083fe5ebc68d4a03a8752908ce1fca11f6f4e1b2d0f82bf3b077
MD5 7ca2f10c689eb4ab423e2a9db3f8033a
BLAKE2b-256 1c5cfe35efc56bcb2db7908b8d30c7013935e0fa16b329a12ccad04fd693d216

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