Changelog¶
All notable changes to oxyz are recorded here. The format follows Keep a Changelog, and the project follows Semantic Versioning.
[Unreleased]¶
1.5.0 - 2026-11-27¶
Added¶
- Free-threaded CPython 3.14 (
3.14t) support: wheels for every platform, and importing oxyz leaves the GIL disabled. Separate threads may read and write concurrently; each iterator andWriterbelongs to one thread at a time.
Performance¶
- Gzip reads are ~13–27% faster and gzip writes 1.7× faster in parallel and
3.5× faster serial, on the
read_gzipandwrite_gzipbenchmarks. Deflate now uses zlib-rs instead of miniz_oxide, and the serial writer no longer feeds the compressor one token at a time. Compressed bytes differ from earlier releases: within 1% in size at the default level, while level 1 is faster but larger (about 40% on the benchmark trajectories), as in zlib. Serial, parallel and batched writes still produce identical bytes.
Fixed¶
- Comparing two
SchemaorFrameIndexobjects with==no longer raisesValueErrorfor a file of more than one frame, andFrameIndexvolumes that are NaN now compare equal. Both are unhashable, asFrameis.
Internal¶
- PyO3 0.30 and rust-numpy 0.30.
- zip 9, ruzstd 0.9, compact_str 0.10 and criterion 0.8, with the rest of
the lockfile refreshed.
oxyz-corenow needs Rust 1.89.
1.4.0 - 2026-11-18¶
Added¶
- Typed records: declare a
Recordand read frames withrecord=onreadandiread, or batches asRecordBatch[R]onread_batchandiread_batch. Fields are statically typed, optional fields batch as filled arrays withbatch.present(...). - Unions of records:
record=A | Breads each frame as the member whose fields it carries;RecordBatch[A | B]holds every member's fields densely, withmembers,tagsandwhere(). - Schema rules take
absent: omit: under project mode an absent optional field is left out of the frame instead of filled. Its type is exported asoxyz.Absent. - Executable README, guide and source-docstring examples checked by default with pytest, covering schemas, typed records, compressed/remote sources, converters and command-line workflows, with a local preview and guarded GitHub Pages deployment.
- Portable repository skills for API selection, development and execution, with a local smoke tour covering typed records, union batches and optional converters.
- Performance documentation with real-dataset and scaling figures, corresponding benchmark tables and an archived measurement snapshot for regeneration.
Changed¶
- Projection promotes an integer value to float for a REAL rule, so an
integer-valued
Latticeno longer fails a project-mode schema; an integer above 2^53 loses precision in the conversion. Validate mode is unchanged.
Fixed¶
- Constructed union batches default presence masks from each frame's tagged member.
- Union batch reads report projection errors and unmatched frames in requested frame order, independent of batch size.
- Documentation examples collect correctly when the checkout path contains a symbolic link.
- Record fields named
clsorselfwork in conversions, batch construction and indexing. - Batches with unsigned offsets support per-atom frame ids and reordered gathers.
- Batch assembly errors report the source file's frame index, including selected frames and later streaming batches.
Internal¶
- ty floor raised to 0.0.100.
- Benchmark plots use website fonts, call-expression labels and output-matched comparisons, with compact measurement provenance. The published snapshot covers MAD full reads and dataset-size scaling.
- Benchmark comparisons pin extxyz 0.4.6 and ase-extxyz 0.1.2.
1.3.1 - 2026-11-13¶
Security¶
- Releases upload per-file SLSA provenance and publish attestations to PyPI. Signing is isolated from read-only builds, and publishing credentials are isolated from project scripts and GitHub Release permissions.
- The PyPI environment accepts only
v*tags; release-tag creation, updates, and deletion are restricted to the repository owner.
1.3.0 - 2026-11-06¶
Added¶
member="*"reads every extxyz entry of a.zip/.tar/.tar.gz/.tar.zstas one stream, on every reader. The CLI spells it--all-members.
Fixed¶
- macOS resource forks (
__MACOSX/,._*) no longer count as extxyz members, so a Finder-zipped archive holding one.xyzreads withoutmember=. - Errors listing archive members show the first ten and a count, instead of every name.
Internal¶
rust-toolchainre-pinned to the current tip ofstable.
1.2.1 - 2026-10-13¶
Added¶
- Python 3.15 support.
oxyz.torch_simis untested on 3.15, as h5py and numexpr publish no cp315 wheels yet.
Internal¶
- uv pinned to 0.13.0.
- torch comes from PyTorch's CPU index on macOS too, the only source of cp315 wheels.
- Lockfile: torch 2.14.1 and its dependants, scipy 1.18.1.
rust-toolchainre-pinned to the current tip ofstable.- The CI zizmor job runs
scripts/zizmor.sh, so it and the pre-push hook share one zizmor version, now 1.30.1. - Comments and docstrings cut back to what the code cannot say, following a
rule now in
AGENTS.md.
1.2.0 - 2026-10-03¶
Added¶
Framederived accessors:frame.positions,frame.numbers,frame.symbols,frame.cell, andframe.pbcresolve the well-known fields from the untouchedcolumns/metadatadicts on each access —cellis the 3x3 ASE-convention cell from the flat Fortran-orderLattice,pbcdefaults toLatticepresence. Nothing is cached and nothing stored is rewritten.- Lookup by name across columns and metadata:
frame["pos"]andframe["energy"]both work, as doname in frame,frame.get(name, default),frame.keys(), and sodict(frame). The value returned is the stored one, not a copy.Batch,Schema(returning theColumnSchemaorMetadataSchema) andSchemaSpec(returning the rule declared under that exact name) behave the same. A name that is both a column and a metadata key raises the newoxyz.AmbiguousNameError(anOxyzError, deliberately not aKeyError) rather than picking one. None of these is aMapping:Frame,SchemaandSchemaSpechave nolen()and cannot be iterated (aBatchiterates its frames, below), so numpy keeps a list of frames as frames —rng.choice(frames, k)andnp.array(frames, dtype=object)still work. Batchis a sequence of its frames.len(batch)isn_framesand iterating yields eachFrame. Indexing follows numpy:batch[i]is aFramewhose numeric arrays are views onto the batch,batch[a:b]is aBatchof views withoffsetsrebased, and a step slice, a list or array of positions, or a boolean mask over frames (batch[batch["energy"] < 0]) gathers a newBatch, a copy, keepingframe_indicesas file provenance. String columns are lists and so are copied; scalar metadata comes out as the Python valueoxyz.readgives, sobatch[i]equals the frame read from the file, dtype for dtype. Being iterable, a batch can be passed straight tooxyz.writeandWriter.write.- Notebook rendering:
Frame,Batch,Schema,SchemaSpecandFrameIndexhave a_repr_html_, so Jupyter shows them as tables — one row per column or metadata key with its dtype, shape and a preview of values; the schema report, a spec's rules, and a scan's atom-count and volume statistics as tables of their own. Previews are bounded: the first 3 rows of an array, arrays in full up to 12 elements, every cell cut at 80 characters, floats to 4 decimal places formatted independently of numpy's global print options. The markup carries no styles or scripts, so the notebook's theme applies, and every name and value is escaped. SchemaSpec.rule_for(name, axis=None): the rule validation would apply to a field of that name — its literal rule, else the first matching glob or regex in declaration order — orNone.oxyz.FieldError(anOxyzError, so still aValueError): a well-known field is absent, or present in a shape or type it cannot hold. Raised by the new accessors — including when the field is present but will not coerce, so aZ:S:1string column reports aFieldErrorrather than numpy'sinvalid literal for int()— and byoxyz.write(see Fixed).
Fixed¶
oxyz.writeandWriter.writecheck every column's row count against the frame'sn_atoms, raisingoxyz.FieldErroron a mismatch. A hand-built short column used to panic inside the Rust encoder, and a long one silently dropped atoms. A 0-D column counts as the one row the encoder writes from it, so the scalar-width-1 form stays legal for a single-atom frame.
Changed¶
- Every public object has a one-line
reprthat prints no data, so its length depends on how many names an object carries rather than how many atoms or frames. Objects that hold data —Frame,Batch,SimStateSource,SystemSource— describe values by numpy dtype and shape ('pos': float64[96, 3]);SchemaandSchemaSpecdescribe a file in the extxyz letters ofProperties=('pos': R:3,'stress': R[3, 3]), joining drifting variants with|and marking an entry some frames lack, or an optional rule, with?. Multi-frame objects show their atom-count range,n_atoms=lo..hi.FrameIndexno longer prints its offset arrays;Writershows its path, non-default options,frames_written, and whether it is closed; the schema rules andViolationomit fields left at their defaults;KindisKind.REAL.str(schema)is still the multi-line report. - A schema violation on a 2-D metadata rule now states the expected shape in
full (
R[3, 3], formerlyR[3]).
Internal¶
- The well-known-field resolution the converters each carried is now one layer:
oxyz._convertownspositions/numbers/symbols/cell/pbcover the plain dicts, andoxyz.metatomicconsumes it instead of its own_cell_and_pbcbody.numbersandMissingSpeciesErrormove out ofoxyz._torch, which imports torch eagerly and so could not backFrame.numbers.oxyz.asekeeps its own routing loop (ASE-table parity), andoxyz.torch_simkeeps its batched, column-vector cell. - New
oxyz._summary: the shape-only repr and the NaN-equal, order-insensitive value comparisonFrameandBatchshare. pytest/pytest-covandboto3/motomove out of thedevgroup into newtestands3-testgroups, whichdevincludes. A plainuv syncresolves to exactly what it did before; the split exists so CI can build a partial environment. The optional dependencies themselves need no group — the tiers install the publishedase/s3extras, the way a user would.- The tier jobs install a single wheel built once by a new
build-wheeljob rather than building their own, so they need no Rust toolchain and exercise the same abi3 artifact a user installs. - A
test-gatefan-in job, mirroringwheels-gate, is now the one status check the branch ruleset needs from this workflow. With matrix contexts named directly, every reshape had to be mirrored by hand in the ruleset — and got it wrong in both directions, stranding required checks that would never report again and adding new ones unprotected. - Coverage is unchanged and still measured only on the full dependency set; the
tiers never pass
--cov, since a partial run is not a coverage figure. - uv pinned to 0.12.17, in
pyproject.tomland everysetup-uvstep. The lockfile is unchanged under it. - Every workflow action re-pinned to its latest release,
rust-toolchainto the current tip ofstable, and zizmor to 1.30.1. The twodownload-artifactpins, which had drifted to different majors, now agree. - Three skip guards did not guard.
tests/test_errors.pytestedfind_spec("metatomic.torch"), which imports the parent package and so raisesModuleNotFoundErrorwhenmetatomicis absent instead of returningNone— aborting collection of the module rather than skipping one test.tests/test_compressed.pyusedimportorskip("oxyz.ase"), which stopped skipping when pytest 9.1 narrowed the defaultexc_typetoModuleNotFoundError:oxyz.aseimports fine and raises a plainImportErrorcarrying its install hint, so pytest now propagates it as a failure. Both are within the project's declaredpytest>=9.0.3range. The ty canary assertedtywas onPATHrather than skipping without it. None of these were visible in CI, because every job installed every dependency. - Tests for the optional targets' import guards: that a missing dependency
raises
ImportErrornaming both the module and the extra to install, and chains the original cause. The imports are blocked in-process, so these run — and are measured by coverage — whether or not the optional dependency is installed, and the guard branches are no longer dead lines in the report. - CI runs the test suite on deliberately incomplete dependency
environments:
base(no optional dependencies),ase, ands3, pinned to 3.12, the abi3 floor, plusbaseon the newest supported interpreter as a forward-compatibility check on the singlecp312-abi3wheel. A tier canary keyed onOXYZ_TEST_TIERasserts the environment is the one CI declared, so a tier that installs too much, or a guard that skips for the wrong reason, fails instead of passing over nothing. Thepythonandcoveragejobs declarefulland are asserted the same way.
1.1.0 - 2026-07-29¶
Added¶
- Read straight from the HuggingFace Hub with
hf://URLs, on every entry point that already took a remote URL —read,iread,scan,infer_schema, the batch readers, and theoxyz.ase/oxyz.metatomic/oxyz.torch_simtargets:oxyz.read("hf://datasets/owner/repo/data/train.extxyz"). The path grammar ishf://[datasets|spaces|models/]owner/repo[@revision]/path, defaulting to a model repo on the default branch. A URL copied from the browser is accepted as well: theblobpage it names is rewritten to the raw-bytes endpoint, so it yields the file rather than markup. Onlyhuggingface.coandhf.coURLs are claimed —http(s)in general is still not a supported scheme. Gated and private repos authenticate withHF_TOKEN(orHUGGING_FACE_HUB_TOKEN), or an explicitstorage_optionsheader, which takes precedence. Needs the existingoxyz[s3]extra; no new dependency. - Read zstd-compressed tars (
.tar.zst,.tzst), locally and from object storage. Datasets shipped this way — the ELEMENTA release among them — were previously unreadable: the extension matched the plain.zstrule, so the tar headers reached the parser and surfaced as an atom-count error. - All three tar codecs are now selectable through
compression=for reading ("tar","tar.gz","tar.zst"), and through--compressiononoxyz scan,check, andfreeze; writing still accepts onlytarandtar.gz. A tar carries no magic bytes, so one under an unrecognised name previously could not be read at all.
Internal¶
- Bumped the developer toolchain: uv 0.12.0, ruff 0.16, ty 0.0.64, rumdl 0.2.45,
prek 0.4.11. uv is now pinned exactly, in both
pyproject.tomland everysetup-uvstep, so CI cannot float off the version the lockfile was written by. - The
ruffselection isselect = ["ALL"]with documented opt-outs, in place of a hand-picked list: each exclusion now carries its reason, and a new release's rules arrive evaluated rather than unnoticed. No change to the shipped behaviour.
1.0.0 - 2026-07-20¶
Added¶
- Schema projection: set
mode="project"on aSchemaSpec(or per call) to reshape every frame to a declared fixed schema — undeclared fields dropped, absent optionals filled — making a mixed-schema file batchable. Available on the frame readers (read,iread), the batch readers, and theoxyz.ase/oxyz.metatomic/oxyz.torch_simoutput targets, all viaschema=/mode=/conformance=. REAL columns fillNaNby default; other kinds take an explicit per-fieldfill.SchemaSpec.freeze(path)expands pattern rules into a project-ready schema, exposed on the CLI asoxyz freezeandscan --emit-schema --project. The batch readers (read_batch,iread_batch) now also acceptschema=/conformance=. Validate-mode behaviour is unchanged. oxyz.metatomicandoxyz.torch_simread/ireadand theirSystemSource/SimStateSourcegainstorage_options=, so reading from an S3-compatible URL works from every output target, as it already did foroxyz.aseand the native readers.oxyz.ase.readgainsthreads=to tune the parallel parse of an eager read (as the native andoxyz.metatomicreaders already had);Noneuses all cores,1is serial.oxyz.ase.ireadstreams and takes nothreads.oxyz.OxyzError, a common base (itself aValueError) for every error the package raises:ParseError,SchemaError, and the converters'ToAseError,FromAtomsError,ToSystemError,ToSimStateErrorall subclass it, soexcept oxyz.OxyzErrorcatches oxyz's errors as a group whileexcept ValueErrorkeeps working.- Export the
Mode("validate"/"project") andWritable(Frame | ase.Atoms, thewriteinput) type aliases fromoxyz, for parity with the already-exportedConformance,Compression, andMemoryScaling. SchemaSpecgainsfrom_jsonandto_file, so every serialisation format now has a matchingfrom_/to_pair (dict,json,yaml,file).oxyz check --conformanceacceptswarn, matching the Python API's conformance levels; likestrictit reports extra columns/keys.- Comment-line metadata now types 2-D arrays (
key=[[1,2],[3,4]]) as shaped arrays, surfaced in Python as 2-D numpy arrays. - A committed MAD-1.5 r²SCAN sample (
tests/data/mad_r2scan_sample.extxyz) in the test corpus, guarding that real, chemically diverse data — 98 elements across molecules, clusters, bulk, surfaces and low-dimensional structures, drawn from a 102-element dataset — parses. - An
examples/directory of runnable, self-contained snippets — scanning and schema inference, reading to numpy, atom-budgeted batching, schema projection, the ASE drop-in, the PyTorch targets, and a write round-trip — each executed in CI against a committed sample. AGENTS.md: a tool-agnostic onboarding guide for coding agents — repo map, theuvbuild/test commands, the TDD loop, and the pre-PR gates.
Performance¶
- Faster whole-file reads, most of all on many-small-frame corpora. Profiling
found the parse allocation-bound — a heap allocation for every species symbol,
metadata key, and short value — which the system allocator serialised, capping
parallel scaling. Storing those short strings inline (they are almost always
≤24 bytes) and no longer allocating a string for metadata values that are only
read cuts allocations by roughly a third. The internal parser and binding
changed; the API and output are unchanged. On the reference corpus fixture the
core read is ~28% faster serial and ~42% faster on 12 threads (thread scaling
2.7×→3.3×); end-to-end
oxyz.readis ~17–19% faster. See benchmarks/RESULTS.md.
Dependencies¶
- Added
compact_str(pure Rust, no C toolchain) for the inline short-string storage above.
Changed¶
- The native frame readers are unified under
readandiread. Both take anindexselection — an int (oneFrame), a slice or slice-string like"1:10:2", or a sequence of non-negative ints (a list, in order); the default":"reads every frame.read_framesbecomesread,iter_framesbecomesiread, and the selection that previously needed separate helpers is now a parameter. Selecting a single frame with a schema (read(path, 0, schema=...)) validates the whole file before indexing, consistent withoxyz.ase.read. - The streaming batch reader
iter_batchesbecomesiread_batch, soread/ireadandread_batch/iread_batchshare one rule:readmaterialises,ireadstreams. MetadataRule's identifier field is renamed fromnametokey, matchingMetadataSchema.keyand the metadatakey=used elsewhere;ColumnRulekeepsname. The YAML/JSON schema format is unchanged (the identifier is the mapping key either way).ParseErrornow locates every parse error structurally.line_numberis renamed toline(matchingViolation.line), andcolumnis the 1-based character column of the offending token within its line — previously it held the offending data column's name.frame_index,line, andcolumnare populated wherever the parser can pin each down, so a malformed file can be located without parsing the message string; the messages themselves now name the expected input, not only the fault.- Comment-line value parsing now conforms to the libAtoms/extxyz key-value
grammar: brace-wrapped scalars and arrays (
{3},{1 2 3}), quoted arrays with embedded separators ([ "a, b", "c]" ]), lowercaset/fbooleans, and Fortrand/Dfloat exponents (-12.0d0) are accepted; malformed values — trailing/leading commas in arrays ([1,2,]), ragged 2-D arrays, unbalanced brackets — are now rejected with a located error rather than silently kept as strings. A bare (unquoted) value containing=,",,,[,],{,}, or\is likewise rejected; quoting the value still permits any of them. Frame.to_ase()is renamed toFrame.to_atoms(), matching theoxyz.ase.to_atomsfunction it delegates to.SchemaSpec.from_yaml_textis renamed toSchemaSpec.from_yaml, pairing withto_yaml(see also the newfrom_json/to_fileunder Added).read_batch'sindices=parameter becomesindex=, takingread's full selection grammar (":", an int, a slice or slice string, or a sequence); the default":"reads the whole file, asindices=Nonedid.- Restructured the README into an onboarding arc — a quickstart front door (install → first read → schema check), the beyond-ASE differences promoted ahead of the compatibility detail, and the PyTorch targets grouped. Content is reorganised rather than removed, bar the out-of-date Roadmap section, which is dropped.
- Docstrings across the public surface completed to the numpy convention and
enforced going forward:
ruff(pydocstyleD) checks formatting on every docstring insrc/oxyzand presence on the public-path modules; a newtests/test_public_docstrings.pychecks presence on the rest of the re-exportedoxyz.__all__surface and theoxyz.ase/oxyz.metatomic/oxyz.torch_simentry points, which ruff cannot see (their definitions live in underscore-prefixed modules).
Removed¶
read_first— useread(path, 0). The never-publicread_frames_slicedhelper is absorbed intoread's slice handling.
Fixed¶
- A parse error on an atom value now reports the column of the exact
offending cell, not the first cell of its column. A bad value in the 2nd or
3rd cell of a multi-width column (e.g.
pos:R:3) previously pointed at the column's first cell instead of the cell that actually failed to parse.
Internal¶
- Hardened the CI and release workflows: every GitHub Action is pinned to a
commit SHA, jobs run with minimal per-job permissions, checkouts set
persist-credentials: false, azizmorgate audits the workflows, and the PyPI publish environment now requires approval. - Widened the
rufflint selection. - Refreshed the locked Python dependencies (numpy 2.5, ASE 3.29, and the dev
and CI toolchain); a
tolistcall was reordered to satisfy numpy 2.5's stricter array stubs, with no change in behaviour. - Refreshed the locked Rust dependencies; the
ndarraypin moves to 0.17 to stay unified with the version thenumpycrate builds against. - Benchmarks now cover the full MAD-1.5 r²SCAN training set (303.5 MiB, 180,184 frames) alongside the generated fixtures; see benchmarks/RESULTS.md.
0.5.0 - 2026-07-03¶
Added¶
- Schema-aware reading: pass
schema=(aSchemaSpecor a path to a.json/.yaml/.tomlfile) andconformance=("strict","required", or"warn") toread_frames,read_first,read_frames_sliced, anditer_frames. Validates each frame's columns, metadata, and structural facts, with frame-indexedSchemaErrors and silenceableSchemaWarnings. Names may be literals, globs (descriptor_*), or regexes (re:...), withcount/min/maxon patterns. oxyz check FILE --schema S: report every schema violation in a file (with frame index and source line), exit non-zero when any is found;--jsonfor CI.oxyz scannow prints a copy-pasteable schema, andoxyz scan --emit-schema PATHwrites it to a.yaml/.jsonfile.Schema.to_spec()exposes the same in Python.
Changed¶
oxyz scan's text summary now shows the inferred schema as pasteable schema syntax rather than a free-form report.
Dependencies¶
- Added PyYAML (
pyyaml>=6) as a runtime dependency, for reading and writing YAML schemas.
0.4.0 - 2026-06-30¶
Added¶
- Reading from compressed files. Every reader (
read_frames,iter_frames,read_batch,iter_batches,read_first,scan,infer_schema, theoxyz.ase/oxyz.metatomic/oxyz.torch_simconverters, and theoxyzCLI) now accepts.gz,.tar.gz,.zip,.zstand.tarpaths and decodes them on the fly —read_frames("run.xyz.gz")just works, with no separate decompression step. Decoding streams, so reads stay parallel without decompressing to a temporary file or holding the whole file in memory; a bare.gzwith several concatenated members is fully read.compression=forces a codec ("infer"default, or"none"/"gzip"/"zstd"/"zip") andmember=selects one entry from a multi-member archive (which otherwise errors, listing its members). A compressed source cannot be seeked, so random-access strategies —iter_batcheswithshuffle,atoms_per_batch, ormemory_scales_with, and reverse/negative ASE indices — either fall back to a full in-memory read (the ASE index path) or raise a clear error pointing at the limitation. Decoders are pure Rust (flate2,ruzstd,zip,tar), so the wheel gains no system dependencies. - Writing extxyz.
oxyz.write(path, obj, ...)takes aFrame, anase.Atoms, or an iterable mixing them and writes (ext)xyz, removing the most common reason to keep ASE in a read → filter → write workflow. Reals are written shortest-round-trippable, soreadthenwritereproduces everyf64bit for bit; columns come outspecies,pos, then the rest, and the comment lineLattice,pbc,Properties, then the rest (a frame lackingspeciesorposis rejected). The codec follows the path extension — plain,.gz,.zip,.tar,.tar.gz— or is forced withcompression=;level=tunes the deflate codecs,"-"writes to stdout, andappend=Trueconcatenates onto an existing plain or gzip file (archives and stdout reject it).oxyz.Writeris the incremental, constant-memory form (a context manager), andoxyz.ase.from_atomsis the inverse ofto_atoms. Writing.zstis not yet supported. Serialisation runs across cores by default —threads=tunes it (Nonefor every core,1for serial), with output bytes identical at any count; only serialisation parallelises, the output stream stays serial.oxyz.Writer(path, batch=n)keeps the incremental form but serialisesnframes at a time in parallel, trading one batch of memory for throughput. - Read extxyz directly from S3-compatible object stores:
read_frames,iter_frames,scan,infer_schema, the batch readers, andoxyz.ase.read/ireadaccepts3:///gs:///az://URLs with the newoxyz[s3]extra. Endpoint and credentials viastorage_options=orAWS_*env vars; all codecs and archivemember=selection supported.oxyz scangains--storage-option.
0.3.0 - 2026-06-27¶
Removed¶
- Python 3.11 support. oxyz now requires Python 3.12+, following
SPEC 0 (a Python version is
dropped three years after release; 3.11's window closed Q4 2025). Wheels are
now abi3 for CPython 3.12+. Users on 3.11 can pin
oxyz<0.3.
Added¶
oxyz.metatomicreads extxyz intometatomic.torch.Systems without an ASE round-trip.read/ireadmirroroxyz.ase(the same index grammar, plusdtype/device/*_requires_gradmatchingsystems_to_torch); aSystemSourcehandle parses a file once and servessystems()alongside array-nativeper_config/per_atomtensor extraction for targets. New optional extraoxyz[metatomic](torch >=2, metatomic-torch). Parity tests hold the result equal tosystems_to_torch(ase.io.read(...)).oxyz.torch_simreads extxyz intotorch_sim.SimState, reproducingtorch_sim.io.atoms_to_state(ase.io.read(...))without the ASE round-trip. BecauseSimStateis natively batched,readreturns a single batched state (the whole selection) andireadstreams the file as batched states (withoxyz.iter_batches's binning knobs); aSimStateSourceserves the state plus array-nativeper_config/per_atomextraction. Cells use torch_sim's column convention, all systems share one pbc (frames that disagree raise), and masses come from amassescolumn or an ASE-parity atomic-weight table. New optional extraoxyz[torch-sim](torch >=2, torch-sim-atomistic); parity tests hold the result equal toatoms_to_state(ase.io.read(...)).oxyz.read_batch(path, indices=None)reads the whole file into oneBatchin a single pass; an empty file yields the empty batch.oxyz.iter_batches(memory_scales_with=..., max_scaler=...)packs frames into balanced bins (best-fit-decreasing) for roughly equal per-batch memory, weighting each frame by"n_atoms"or by"n_atoms_x_density"(n_atoms**2 / volume, a proxy for the neighbour-graph size that drives MLIP memory). A frame over the budget gets its own bin; provenance is kept inframe_indices.oxyz.scan(path, with_volume=True)additionally records each frame's cell volume|det(Lattice)|inFrameIndex.volumes(NaNwhere a frame has noLattice), reading one extra line per frame; it backs the density weight.
0.2.0 - 2026-06-25¶
A performance release: faster reads across the board, no API changes. Numbers are means on an Apple M3 Pro under CPython 3.13; full tables are in benchmarks/RESULTS.md.
Performance¶
- ASE conversion (
oxyz.ase.read) is 18–57% faster: the eager list read now parses on every core, and species map to atomic numbers through a cached lookup so ASE skips its own per-atom symbol parsing. Reading the 4 × 100 000 atom file toase.Atomsdrops 167 → 71 ms — now faster than the libAtoms C parser's ASE plugin, which 0.1.0 was slower than on that workload. - Files with a few very large frames now scale past four threads: a frame's atom rows are split across workers (4 × 100 000 atom read, all cores, 36 → 27 ms).
- Batched reads (
read_batch,iter_batches) reuse one worker pool across batches instead of rebuilding it per batch, restoring thread scaling (2 000-frame batched read, all cores, 15.8 → 12.4 ms). - The atom-row parser tokenises raw bytes, validating UTF-8 only for string cells, lifting single-thread parse throughput ~15%.
Changed¶
- A non-UTF-8 byte in a numeric atom cell now raises
ParseError(an invalid value) rather than anOSError; a non-UTF-8 byte in a string cell still raises the I/O error, as before. Atom rows are now tokenised as bytes, so only string cells are validated as UTF-8.
0.1.0 - 2026-06-16¶
First public release: a Rust extxyz parser behind a small, typed Python API, for reading atomistic-simulation datasets into numpy or ASE.
Added¶
read_frames(parallel) anditer_frames(streaming, constant memory) for whole-file reads, andread_firstfor the first frame alone. Column names and metadata are preserved as written, without aliasing or normalisation.read_batchanditer_batchesfor atom-major concatenated batches, the latter packing by a fixed frame count or an atom budget, with an optional seeded shuffle. Batch composition does not depend on the thread count.scanfor a file's structure — byte offsets and atom counts, without parsing frame contents — andinfer_schemafor a one-passSchemaof the columns and metadata keys, their types and shapes, and how consistently they appear across frames.FrameandBatchas frozen dataclasses;Batchcarries the CSR layout PyTorch Geometric expects (offsets/ptr,batch,frame_indices).oxyz.ase:readandireadas drop-ins forase.io.read/ireadover extxyz, with ASE's full index grammar, plusto_atomsandFrame.to_ase. Requires the optionalaseextra.oxyz.ParseError, aValueErrorcarrying theframe_index,line_number, andcolumnof the offending input.- An
oxyzcommand-line tool;oxyz scansummarises a file and its inferred schema (--no-schema,--json). - Type stubs and
py.typed; numpy is the only required runtime dependency. - abi3 wheels for CPython 3.11 and newer on Linux (x86_64, aarch64), macOS (arm64, x86_64), and Windows (x64).