Migrating from numeric coercion
The DataSchemer (DS) processor accepts DataCanon Instances (DCIs) and replaces
the former numeric coercion engine.
data_schemer.coerce_numbers and the temporary data_schemer.dci_projector
module have been removed. The public processor is
data_schemer.schema_projector.SchemaProjector.
Move parsing to the input boundary
from data_canon import parse_shorthand
from data_schemer.schema_projector import SchemaProjector
input_dci = parse_shorthand('{"matrix": <1 0; 0 1>}', preprocess=True)
projector = SchemaProjector({"variables": {"matrix": {}}})
projection = projector.get_projection(input_dci)
assert projection.data == {"matrix": [[1, 0], [0, 1]]}
A standalone projector receives a DCI. SchemaCommandLine (SCL) handles text parsing at its own boundary and then invokes that same processor.
Replace the former contracts
| Former interface | DCI-based interface |
|---|---|
| Raw dictionary input to projection | Mapping DCI with String field keys |
Required type on every field | Optional exact DataCanon Type (DCT) constraint |
int, float, string input type names | Integer, Float, String |
float-matrix, vector domains, shaping coercion | DataCanon (DC) List/Array input and application-level array conversion |
| Implicit expression evaluation and named array tokens | DC Shorthand, optional preprocessing, explicit eval(...) |
update_variables | Field-property overrides under variables |
raw_data | input_dci for original input |
Per-input child_projectors | projection.child_projections |
data_string / raw_data_string | Explicit DC rendering of the selected DCI view |
data_tuple, variable_choices, domain_definitions | Removed; use conventional output, schema choices, and application conversion |
Field-property inheritance is now explicit: the first listed base wins explicit property conflicts, and local properties override inherited ones. A supplied child Mapping is projected; an absent child stays absent. SCL’s inclusive navigation does not activate children.
The old numpy_print.py and render_data.py formatting modules and SCL’s
numerical report controls have also been removed. Use DC rendering for
interchange and application code for specialized reports.
The input guide and projection guide cover the new workflow. The behavioral reference records the resolved rules.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.