Skip to content

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 30 Jun 19:02
· 340 commits to main since this release
52f40e2

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_sim converters, and the oxyz
    CLI) now accepts .gz, .tar.gz, .zip, .zst and .tar paths 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
    .gz with several concatenated members is fully read. compression= forces a
    codec ("infer" default, or "none"/"gzip"/"zstd"/"zip") and member=
    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_batches with shuffle, 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 a Frame, an ase.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, so read then write reproduces every f64 bit for
    bit; columns come out species, pos, then the rest, and the comment line
    Lattice, pbc, Properties, then the rest (a frame lacking species or
    pos is rejected). The codec follows the path extension — plain, .gz,
    .zip, .tar, .tar.gz — or is forced with compression=; level= tunes
    the deflate codecs, "-" writes to stdout, and append=True concatenates
    onto an existing plain or gzip file (archives and stdout reject it).
    oxyz.Writer is the incremental, constant-memory form (a context manager),
    and oxyz.ase.from_atoms is the inverse of to_atoms. Writing .zst is not
    yet supported. Serialisation runs across cores by default — threads= tunes
    it (None for every core, 1 for 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 serialises n
    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/iread accept s3:///gs:///az:// URLs with the new
    oxyz[s3] extra. Endpoint and credentials via storage_options= or AWS_*
    env vars; all codecs and archive member= selection supported. oxyz scan
    gains --storage-option.