Architecture and ownership¶
The core has no Python or converter-library knowledge. The binding moves whole arrays across the Python boundary and releases the interpreter for parsing. The Python layer owns user-facing selection, schema policy, record declarations and conversion conventions. Follow these boundaries rather than adding a second implementation of an existing policy.
Source and test map¶
Paths below are relative to the repository root. Links point to tracked source; the adjacent tests are the starting point for a focused change, not an exhaustive list of all coverage.
Public contract map¶
Keep the user-facing contract beside its implementation owner when changing behaviour. These pages cover completed workflows; the source/test map above identifies the authoritative files and regression suites.
| Contract | Public documentation | Owning layer |
|---|---|---|
| Frame selection and partial reads | Reading, storage | Python reader/selection policy; Rust parsing and structural indexing |
| Concatenation, provenance and batch strategy | Batching, data model | Rust batch assembly; Python batch planning and sequence views |
| Observations, validation and projection | Schemas guide, schema concepts | Rust signature fold/projection; Python rules, matching and policy |
| Typed fields and schema binding | Typed records | Python declarations, field validation and record binding |
| Union identity and missingness | Mixed datasets, data model | Python union matching and record-batch reconstruction; native presence reporting |
| Encoding, codecs and append restrictions | Writing | Rust encoding; Python writer input marshalling |
| Stored values and interpretation | Format, compatibility | Rust grammar/model; Python accessors and optional converters |
| Public names and failure context | API, errors | Root exports and inline types/stubs; owning layer's structured exceptions |
Boundary contracts¶
The native frame preserves names, kinds and values rather than applying ASE conventions. Numeric and boolean columns cross as NumPy arrays; string columns use Python lists. Converter-specific renaming and shape/unit conventions belong in converters, not the parser. See the lossless-core decision.
Structural scanning discovers frame boundaries/counts without fully parsing atom
values. Schema inference parses and folds observed signatures. A declared
SchemaSpec is policy, not an inferred description; Python compiles and enforces
that policy while Rust applies projection and assembles arrays. See
schemas and projection.
Records bind declarations to the same reader/projection path. Optional values on individual records differ from filled dense batch storage; presence masks and union tags preserve the distinction. See typed records and unions.
Schema and record change routing¶
- Observed variants and promotion summaries: Rust
schema.rs, Python_schema.py; start withtest_schema.pyandschema_inference.rs. - Spec parsing, literal/glob/regex precedence and serialisation:
_schema_spec.py;test_schema_spec.py. - Inference-to-spec emission:
_schema_emit.py;test_schema_emit.py. - Structured violations and conformance policy:
_schema_match.py;test_schema_match.py._project.pycompiles projection and freezes patterns;test_project.pyandtest_schema_read.pycover integration. Rustproject.rsowns value projection and presence reporting, withprojection.rscovering its core behaviour. - Field declarations and runtime shape/dtype checks:
_record.pyand_record_fields.py;test_record.pyandtest_record_fields.py.test_record_typing.pyseparately checks consumer types with ty. - Agreement between
record=andschema=, projection plans and owned/view conversion:_record_bind.py;test_record.pyandtest_record_batch.py. - Sibling-union compatibility, signature matching and ambiguity:
_record_union.py;test_record_union.py. - Dense fields, presence, tags and row reconstruction:
_record_batch.py;test_record_batch.pyandtest_record_union.py. - Reader selection, warning/drop handling and original source indices:
_frames.py,_batch.pyand_select.py; schema-read, record and union tests above exercise these entry points.
Do not route missingness through the plain batch builder: a Batch has no
presence mask. Do not infer union identity from filled values: tags and masks
must survive slicing and gathering, including after warning-mode frame drops.
Export and verification obligations¶
src/oxyz/__init__.py defines root exports and __all__. Public Python APIs have
inline annotations; the compiled module is described by _rust.pyi and checked
against the real module by stubtest. Changes to exported binding symbols must
update the stub in the same change. py.typed marks the package as typed.
pyproject.toml owns Python/build dependencies and uv rebuild cache keys;
Cargo.toml and crate manifests own Rust dependencies/features. The
test guide maps these boundaries to verification commands. Use
benchmark evidence for performance claims, and keep optional
libraries behind their target boundary.