Gaps with Python asdf

Copy Markdown View Source

Compared on 4 December 2026. This library is 0.1.0 and targets ASDF standard 1.5.0. The reference library is asdf 6.0.0 (released 19 October 2026), which writes core schemas 1.6.0 from asdf-standard 1.5.0. The package version and the core-schemas version are different numbers.

Both libraries use file format 1.0.0 and one YAML 1.1 document. A default Python file carries #ASDF_STANDARD 1.6.0. This library writes 1.5.0 and still opens a 1.0.z file whose comment says 1.6.0. The comment does not add 1.6.0 behavior. core-1.6.0 lists ndarray-1.1.0 and omits ndarray-1.0.0. This library emits ndarray-1.0.0 for every dtype except float16, which uses ndarray-1.1.0.

The Python round trip and both CI rows in Compatibility are not run. The tables below are a reading of both codebases. They are not a measured interop result.

What stops a file Python wrote

An unknown compression label and a non-finite YAML scalar abort ASDF.open/1 before the tree is usable. The array rows fail later, when the payload is decoded.

CapabilityPython asdf 6.0.0This libraryEffect
bzp2 blocksBuilt in:unsupported_compressionOpen fails
lz4 and any other compression labellz4 is an optional extra; other codecs are extensions:unknown_compressionOpen fails when the file uses that label
YAML .inf and .nanAccepted:unsupported_floatOpen fails
Streamed shape ['*', …]One uncompressed last block, source: -1Shape must be a list of non-negative integersDecode fails
Exploded ndarray (a sibling .asdf file)Opens the sibling and reads block 0The URI is stored; decode returns :external_disabledDecode fails
ucs4 arraysDecoded as UnicodeThe datatype parses; the decoder returns :invalid_ndarrayDecode fails
Negative stridesRead with NumPy order "A":unsupported_strideDecode fails

A default Python write is uncompressed, so bzp2 and lz4 are absent from that file. They are present in any file that asked for them. bzp2 ships with every asdf 6.0.0 install. lz4 does not.

:permissive does not recover these rows. Its two recoveries are a duplicate YAML key and a block index that does not match the forward scan.

What a written file is missing

An ordinary asdf 6.0.0 file is #ASDF 1.0.0, #ASDF_STANDARD 1.6.0, YAML 1.1, root tag asdf-1.1.0, history with asdf_library and extension metadata, uncompressed blocks, an MD5 of the stored bytes, a block index, and ndarray-1.1.0 for the arrays in the 1.6.0 examples. Python 4.0.0's notes say older standards stay readable. That claim was not retested here.

Contents of a default 6.0.0 filePython asdf 6.0.0ASDF.write/3
#ASDF 1.0.0, %YAML 1.1, %TAG ! tag:stsci.edu:asdf/WrittenWritten
Root asdf-1.1.0 for a mapWrittenA bare map is wrapped with that tag
Default compression none, zlib available"input" by default, zlib on request:none by default, :zlib on request
Checksum and block indexWritten; the index is omitted for a streamed fileWritten when any block exists
#ASDF_STANDARD 1.6.0DefaultHardcoded 1.5.0
history, asdf_library, extension metadataWrittenOmitted. Whether the schema requires them was not checked
ndarray tag1.6.0 examples use ndarray-1.1.0ndarray-1.0.0, except float16
Non-C viewSaved as the view since 6.0.0Packed to C order. Strides and offset are dropped
Streamed blockSupportedThe flag is never set
Structured, ucs4, and complex binary samplesWritten:unsupported_write
bzp2 and lz4Writable (lz4 needs the extra)No writer clause
Anchors for a recursive treeEmittedNo anchor or alias emitter
Exploded sibling filesOne file per blockA relative path may be recorded. The sibling file is not created
Schema check on writeDocumented since 4.0.0write/3 does not validate
Integer and boolean keysLegal from core schemas 1.6.0:invalid_key unless every key is a binary
.inf and .nanRepresentable:unsupported_float

Partial types

These open, and the value is a narrower Elixir term than the Python object.

CapabilityPython asdf 6.0.0This library
ndarray-1.0.0 and ndarray-1.1.0numpy.ndarray%ASDF.Array{}. Payloads stay unread until to_list, slice, or stream
Integer, float64, and ascii arraysNumPy valuesExact integers, Elixir floats, ascii binaries
float16 and float32NumPy values, including non-finite%ASDF.Float16{} and %ASDF.Float32{} until widen: true, which raises on infinity and NaN
complex64 and complex128 arraysNumPy complex%ASDF.Complex{}. complex64 keeps binary32 bits until widen
complex-1.0.0 scalar, integer-1.1.0Python complex, IntegerType%ASDF.Tagged{}
software, history, extension metadataSmall records%ASDF.Tagged{}. Several of the schemas are vendored
Structured dtypeA list of fieldsRead as maps in field order. There is no struct write clause
Positive strides that are not C orderByte stridesto_list gathers them. slice returns :unsupported_slice
ndarray schemaValidated, with ndim and datatype checksndarray, integer, and datatype schemas are skipped as :cyclic_ref
Tag handlersConverter and ManifestExtension, on read and writeASDF.Registry is empty, read-side, and does not cover the two ndarray tags
ndarray-1.2.0Registered. Active when core schemas 1.7.0 are enabledStays tagged. A default 6.0.0 process does not write it

Already the same

File format 1.0.0 for a file this library writes, and any 1.0.z patch on read. One YAML 1.1 document ended by .... The root tag tag:stsci.edu:asdf/core/asdf-1.1.0 for a bare map. Uncompressed blocks and zlib. An MD5 of the stored bytes and a block index on a non-streamed file. Block payloads left unread at open (lazy_load defaults to true in Python; this library reads headers only). Unknown tags kept as tagged nodes when validation is off. Both libraries default that validation to off. Neither memory-maps by default.

Units, time, FITS, coordinates, transforms, and GWCS are outside the asdf package. They ship in asdf-astropy and gwcs. Without those packages, Python keeps the tagged YAML and warns. This library already does that for every tag it does not decode. ASDF-in-FITS was removed from asdf in 3.0.0.

Stricter on purpose

These stay. They reject inputs the Python defaults accept, and they are checks rather than missing features.

CheckPython asdf 6.0.0This library
MD5Written by default. Open skips the check unless askedChecked when the payload is read and any checksum byte is set
Block indexA bad index warns and the reader scans:strict requires the offset list. :permissive keeps the scan and warns
bool8A NumPy boolA byte other than 0 or 1 is :invalid_ndarray
YAML 1.1 words yes, on, null, 010The emitter was not comparedDouble-quoted, so they stay strings
Size capsNo matching cap was recordedASDF.Limits. A declared block above max_block_bytes is :decompression_bomb before inflate

Tooling

asdftool provides info, diff, edit, explode, implode, search, validate, tags, and extensions. mix asdf.inspect prints the format version, the standard version, the top-level keys, and each block's compression and sizes. It does not decode payloads. In-place update, search, copy, and history editing have no counterparts here. Opening an http or https URI needs the optional fsspec extra in Python. This library stores the URI and does not fetch it.

Not measured

  • ASDF.PythonOracleTest checks three scalar keys when asdf exactly 6.0.0 imports. python3 -c "import asdf" failed on 30 November 2026 and was not repeated. The test never looks at a block, a dtype, a 1.6.0 comment, or a history entry.
  • The Linux and macOS CI rows in the compatibility matrix have workflow files and no recorded run from this tree.
  • The core-1.5.0 manifest was not line-checked for ndarray-1.0.0, ndarray-1.1.0, and integer-1.1.0.
  • Whether asdf-1.1.0 requires history was not checked.
  • Python's duplicate-key behavior and its handling of YAML merge keys were not recorded.
  • Byte-identical zlib output was not compared.

Roadmap

0.1.0 is the current release. Each version below is one delivery. The same list is on the landing page. The checks in Stricter on purpose stay in every release.

ReleaseDeliveryDone when
0.2.0Ordinary files round-trip with asdf 6.0.0A written file and an uncompressed default Python file open in the other library. The written file uses one manifest: the standard comment, ndarray tags including float16, and integer tags agree, and history and asdf_library are written when that schema requires them. asdf 6.0.0 reads back a map plus C-contiguous int, float64, float32, and float16 arrays. The Python file carries core schemas 1.6.0, history, a checksum, and a block index; the numeric block decodes and history stays %ASDF.Tagged{}. YAML .inf and .nan, and non-finite float16 and float32 payloads, open as an explicit term. Finite float16 and float32 stay bit containers, and widen: true still raises on a non-finite value. The oracle runs.
0.3.0bzp2 and lz4 blocksA bzp2 block round-trips. An lz4 block round-trips when the codec is available. Any other compression label remains an error.
0.4.0String and structured columnsucs4 and a structured dtype round-trip.
0.5.0Strided arraysA negative stride round-trips. ASDF.Array.slice/2 accepts an array that is not C order.
0.6.0Streamed blocksA streamed shape * round-trips: one uncompressed last block, and no block index.
0.7.0External blocksAn external block is written as a sibling file under external_root and opened on read. A path with .., a leading /, or a :// URI remains rejected.
0.8.0Complex binary samplescomplex64 and complex128 arrays round-trip as binary blocks.
0.9.0Cyclic treesA cyclic mapping round-trips through anchors and aliases.
0.10.0Integer and boolean keysInteger and boolean mapping keys round-trip.
0.11.0Validated writesASDF.write/3 validates the tree before it returns, including the ndarray schemas that 0.1.0 skips.

Diff, edit, explode, implode, and search are outside this series. So are units, time, coordinates, FITS, transforms, and GWCS. asdf 6.0.0 keeps those in asdf-astropy, gwcs, and asdftool.