Skip to main content

lima2mxh5master

lima2mxh5master creates, updates, and inspects NeXus/HDF5 master files for macromolecular crystallography workflows.

The project is currently in beta. Schema documents declare their specification version and whether they create or update a file; bundled transformation profiles also carry their own name and version.

Installation

Python 3.10 or newer is required.

python -m pip install lima2mxh5master

For a development checkout:

python -m pip install -e .

Create a file

from lima2mxh5master.api import dump_dict_to_nx

create_schema = {
    "spec_version": 1,
    "operation": "create",
    "registry": {"source_dir": [], "classes": {}},
    "schema": {
        "entry": {
            "@NX_class": "NXentry",
            "title": "Example scan",
            "data": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
        }
    },
}

dump_dict_to_nx(create_schema, "master.h5")

Update a file

from lima2mxh5master.api import update_h5_from_dict

update_schema = {
    "spec_version": 1,
    "operation": "update",
    "registry": {"source_dir": [], "classes": {}},
    "schema": {
        "entry": {
            ">=sampled": "${h5:self:/entry/data}[::10]",
        }
    },
}

update_h5_from_dict(
    update_schema,
    path_h5_base_file="master.h5",
    path_h5_output_file="sampled_master.h5",
)

${h5:self:/entry/data} explicitly reads the original base file; ${h5:/entry/data} is the equivalent shorthand. Schemas can also declare named external inputs and reference them as ${h5:source_name:/entry/data} in create or update operations. Literal inputs use ${h5:<../raw/data.h5>:/entry/data}, and vds.concatenate([...], axis=0) combines sliced HDF5 references into a virtual dataset without reading frame data.

See the full documentation for schema syntax, in-place updates, deletions, HDF5 references, and bundled profiles.

Metadata

Release files for lima2mxh5master 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lima2mxh5master 0.0.4
File Size Uploaded
lima2mxh5master-0.0.4.tar.gz 69.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lima2mxh5master 0.0.4
File Interpreter ABI Platform
lima2mxh5master-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 143.7 kB

Release files / lima2mxh5master-0.0.4.tar.gz

Download URL lima2mxh5master-0.0.4.tar.gz
Size 69.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9c0a938db86b3469f8b0d2d0e60b63aed4d96d87ca260cedab42ef621c769075
BLAKE2b-256 checksum
How to use checksums
b6361fdfc01fd93de2e4d54b0054f2ee1e4e07d67952f34d8c39868a364cf407
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / lima2mxh5master-0.0.4-py3-none-any.whl

Download URL lima2mxh5master-0.0.4-py3-none-any.whl
Size 73.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
64ab5a82418d613e1f1c951c7575a1f9c5c6e570ccd9a4a11bae1977ef27176e
BLAKE2b-256 checksum
How to use checksums
61b43515815703e8eb75c20a983fd324e5de6dcebf95242fb91a14f63e93de36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release history Release notifications | RSS feed

1.0.0

2 release files

0.1.0

2 release files

This release

0.0.4 This release

2 release files

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page