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 1.0.0

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 1.0.0
File Size Uploaded
lima2mxh5master-1.0.0.tar.gz 73.8 kB Details

Built distribution (wheel)

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

Total release size: 152.9 kB

Release files / lima2mxh5master-1.0.0.tar.gz

Download URL lima2mxh5master-1.0.0.tar.gz
Size 73.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0e35b2f54c14f1b356fdb283ba6544e622f3f72b21e0f4d17ba30b5e420165d5
BLAKE2b-256 checksum
How to use checksums
5a1fcbdb86d7dd91390fce42352923db5acd16f23ea3a72ca86b95977e430cbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

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

Download URL lima2mxh5master-1.0.0-py3-none-any.whl
Size 79.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d901cd62a7ae95604ef12f4141b0adbb7d5b09f1d4a428cd7107a79d6b338432
BLAKE2b-256 checksum
How to use checksums
39e7a5673d60e1e40bd8a79ba702d4761be0017177cdbf0a1bd8ca19613fffcf
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

This release

1.0.0 This release

2 release files

0.1.0

2 release files

0.0.4

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