Skip to main content

zincware codecov PyPI version Binder H5MD Discord

ZnH5MD - ASE Interface for the H5MD format.

ZnH5MD provides and interface from ASE to H5MD and vice versa. Install via pip install znh5md. Similar to ASE ZnH5MD provides read and write functionality:

import znh5md
from ase.collections import s22

znh5md.write("s22.h5", list(s22))
print(list(znh5md.iread("s22.h5")))
# list[ase.Atoms]

Further, you can access any data from within the entire dataset through the znh5md.IO class which provides a MutableSequence-like interface.

import znh5md
from ase.collections import s22

io = znh5md.IO("s22.h5", particles_group="s22")
io.extend(list(s22))

print(io[5:10])
# list[ase.Atoms]

Extended H5MD Format

ZnH5MD circumvents two current limitations of the H5MD standard.

  • support atoms with varying particle counts by padding the dataset with np.nan. Using varying species counts might break the compatibility with other H5MD tools.
  • support varying pbc within a single particle group by introducing particles/<group>/box/pbc/value in addition to the particles/<group>/box attributes. By default, this is enabled via IO(pbc_group=True). The particles/<group>/box attribute will be set to the PBC conditions of the first frame. Using this feature will not typically not break ompatibility with other H5MD tools but can lead to unexpected behaviour.

Supported

atoms.info entry

dict and list entries assume python standard types if not otherwise specified.

Type ZnH5MD
np.ndarray ✅
float ✅
str ✅
dict ✅
list ✅
list[np.ndarray] ✅
dict[str, np.ndarray] ❌
list[dict] ❌

atoms.arrays

Type ZnH5MD
np.ndarray ✅
float ✅
str ✅
dict ✅
list ✅
list[np.ndarray] ✅
dict[str, np.ndarray] ❌
list[dict] ❌

atoms.calc.results

Type ZnH5MD
np.ndarray ✅
float ✅
str ✅
dict ✅
list ✅
list[np.ndarray] ✅
dict[str, np.ndarray] ❌
list[dict] ❌

Current limitations

This is a not necessarily complete list of Limitations that will be fixed eventually. Any contributions are welcome.

  • Step: ZnH5MD assumes a fixed time interval of 1.
  • Units: There is no automatic unit conversion through e.g. the pint package
  • performance tweaks: there are many places in ZnH5MD that can be optimized for better performance. Currently most of the values are hard-coded, such as chunk size. Nevertheless, ZnH5MD outperforms most other packages w.r.t. read and write speed.

Metadata

Release files for znh5md 0.4.8

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

Source distribution (sdist)

Source distribution for znh5md 0.4.8
File Size Uploaded Provenance
znh5md-0.4.8.tar.gz 203.7 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 228.2 kB

Release files / znh5md-0.4.8.tar.gz

Download URL znh5md-0.4.8.tar.gz
Size 203.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9dd02d45b5ed766e2f6a0c5b8c926cd15e5a8b9c3a80cab0303f518b129f16ac
BLAKE2b-256 checksum
How to use checksums
93d450b9ad618d799983823ef4087033dcb7e90ffe95cb02fbdda01cd7fa0d66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.19

Release files / znh5md-0.4.8-py3-none-any.whl

Download URL znh5md-0.4.8-py3-none-any.whl
Size 24.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
83e7c82424ae94e6b4d8a1704447c32eb7303e0c11c4d73605482fe0911ce267
BLAKE2b-256 checksum
How to use checksums
81034ceb3cec2f1b466c2c4dc609fd236dc064a1da1c612c89c12d2afeeaf0a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.19

Security for znh5md 0.4.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.8 This release

2 release files No provenance

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