You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Added
Schema projection: set mode="project" on a SchemaSpec (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 the oxyz.ase/oxyz.metatomic/oxyz.torch_sim output targets, all via schema=/mode=/conformance=.
REAL columns fill NaN by default; other kinds take an explicit per-field fill. SchemaSpec.freeze(path) expands pattern rules into a project-ready
schema, exposed on the CLI as oxyz freeze and scan --emit-schema --project. The batch readers (read_batch, iread_batch) now also accept schema=/conformance=. Validate-mode behaviour is unchanged.
oxyz.metatomic and oxyz.torch_simread/iread and their SystemSource/SimStateSource gain storage_options=, so reading from an
S3-compatible URL works from every output target, as it already did for oxyz.ase and the native readers.
oxyz.ase.read gains threads= to tune the parallel parse of an eager read
(as the native and oxyz.metatomic readers already had); None uses all
cores, 1 is serial. oxyz.ase.iread streams and takes no threads.
oxyz.OxyzError, a common base (itself a ValueError) for every error the
package raises: ParseError, SchemaError, and the converters' ToAseError, FromAtomsError, ToSystemError, ToSimStateError all subclass it, so except oxyz.OxyzError catches oxyz's errors as a group while except ValueError keeps working.
Export the Mode ("validate"/"project") and Writable
(Frame | ase.Atoms, the write input) type aliases from oxyz, for parity
with the already-exported Conformance, Compression, and MemoryScaling.
SchemaSpec gains from_json and to_file, so every serialisation format
now has a matching from_/to_ pair (dict, json, yaml, file).
oxyz check --conformance accepts warn, matching the Python API's
conformance levels; like strict it 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,
the uv build/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.read is ~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 read and iread. Both take an index selection — an int (one Frame), 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_frames becomes read, iter_frames becomes iread, 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 with oxyz.ase.read.
The streaming batch reader iter_batches becomes iread_batch, so read/iread and read_batch/iread_batch share one rule: read
materialises, iread streams.
MetadataRule's identifier field is renamed from name to key, matching MetadataSchema.key and the metadata key= used elsewhere; ColumnRule
keeps name. The YAML/JSON schema format is unchanged (the identifier is the
mapping key either way).
ParseError now locates every parse error structurally. line_number is
renamed to line (matching Violation.line), and column is the 1-based
character column of the offending token within its line — previously it held
the offending data column's name. frame_index, line, and column are
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]" ]), lowercase t/f booleans,
and Fortran d/D float 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 to Frame.to_atoms(), matching the oxyz.ase.to_atoms function it delegates to.
SchemaSpec.from_yaml_text is renamed to SchemaSpec.from_yaml, pairing with to_yaml (see also the new from_json/to_file under Added).
read_batch's indices= parameter becomes index=, taking read's full
selection grammar (":", an int, a slice or slice string, or a sequence);
the default ":" reads the whole file, as indices=None did.
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 (pydocstyle D) checks formatting on every
docstring in src/oxyz and presence on the public-path modules; a new tests/test_public_docstrings.py checks presence on the rest of the
re-exported oxyz.__all__ surface and the oxyz.ase/oxyz.metatomic/ oxyz.torch_sim entry points, which ruff cannot see (their definitions
live in underscore-prefixed modules).
Removed
read_first — use read(path, 0). The never-public read_frames_sliced
helper is absorbed into read'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, a zizmor gate audits the workflows, and the
PyPI publish environment now requires approval.
Widened the ruff lint selection.
Refreshed the locked Python dependencies (numpy 2.5, ASE 3.29, and the dev
and CI toolchain); a tolist call was reordered to satisfy numpy 2.5's
stricter array stubs, with no change in behaviour.
Refreshed the locked Rust dependencies; the ndarray pin moves to 0.17 to
stay unified with the version the numpy crate 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.