Repository navigation
Releases
Releases · theochemtheo/oxyz
v1.5.0
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 theread_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 raises
ValueErrorfor 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.
v1.4.0
Added
- Typed records: declare a
Recordand read frames withrecord=onread
andiread, or batches asRecordBatch[R]onread_batchand
iread_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, with
members,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 as
oxyz.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-valuedLatticeno 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.
v1.3.1
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.
v1.3.0
Added
member="*"reads every extxyz entry of a.zip/.tar/.tar.gz/.tar.zst
as 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.
v1.2.1
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 inAGENTS.md.
v1.2.0
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"]and
frame["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 theColumnSchemaor
MetadataSchema) 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 a
KeyError) rather than picking one. None of these is aMapping:Frame,
SchemaandSchemaSpechave nolen()and cannot be iterated (aBatch
iterates 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 a
Framewhose numeric arrays are views onto the batch,batch[a:b]is a
Batchof 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 to
oxyz.writeandWriter.write.- Notebook rendering:
Frame,Batch,Schema,SchemaSpecandFrameIndex
have 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;Writer
shows 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 of
oxyz._torch, which imports torch eagerly and so could not back
Frame.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 new
testands3-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-artifact
pins, which had drifted to different majors, now agree. - Three skip guards did not guard.
tests/test_errors.pytested
find_spec("metatomic.torch"), which imports the parent package and so raises
ModuleNotFoundErrorwhenmetatomicis 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_typeto
ModuleNotFoundError:oxyz.aseimports fine and raises a plain
ImportErrorcarrying 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
raisesImportErrornaming 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 declare
fulland are asserted the same way.
v1.1.0
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 is
hf://[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 bothpyproject.tomland every
setup-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.
v1.0.0
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 the
oxyz.ase/oxyz.metatomic/oxyz.torch_simoutput targets, all via
schema=/mode=/conformance=.
REAL columns fillNaNby default; other kinds take an explicit per-field
fill.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 accept
schema=/conformance=. Validate-mode behaviour is unchanged. oxyz.metatomicandoxyz.torch_simread/ireadand their
SystemSource/SimStateSourcegainstorage_options=, so reading from an
S3-compatible URL works from every output target, as it already did for
oxyz.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, so
except oxyz.OxyzErrorcatches oxyz's errors as a group while
except 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-endoxyz.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 an
indexselection — 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_framesbecomes
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 withoxyz.ase.read. - The streaming batch reader
iter_batchesbecomesiread_batch, so
read/ireadandread_batch/iread_batchshare one rule:read
materialises,ireadstreams. MetadataRule's identifier field is renamed fromnametokey, matching
MetadataSchema.keyand the metadatakey=used elsewhere;ColumnRule
keepsname. 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 the
oxyz.ase.to_atomsfunction it delegates to.SchemaSpec.from_yaml_textis renamed toSchemaSpec.from_yaml, pairing with
to_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 new
tests/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_sliced
helper 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); atolistcall 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.
v0.5.0
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, and
iter_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.
v0.4.0
Added
- Reading from compressed files. Every reader (
read_frames,iter_frames,
read_batch,iter_batches,read_first,scan,infer_schema, the
oxyz.ase/oxyz.metatomic/oxyz.torch_simconverters, and theoxyz
CLI) 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, or
memory_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 line
Lattice,pbc,Properties, then the rest (a frame lackingspeciesor
posis 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 serialisesn
frames 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, and
oxyz.ase.read/ireadaccepts3:///gs:///az://URLs with the new
oxyz[s3]extra. Endpoint and credentials viastorage_options=orAWS_*
env vars; all codecs and archivemember=selection supported.oxyz scan
gains--storage-option.