euromod_linking.ingest¶
Universal shock ingest: (external model output file, mapping spec) -> canonical shock-table records.
Mapping specs are declarative, repo-versioned YAML files in
euromod_linking/mappings/, validated against mapping.v1.schema.json.
Anything a spec cannot express becomes a new named transform here — mappings
stay data, code stays reviewed.
Exceptions¶
Inappropriate argument value (of correct type). |
Functions¶
|
Read an external model output file through a mapping spec. |
|
Available mapping specs: [{name, description, file}]. |
|
Load + schema-validate a mapping spec by name (mappings/{name}.yaml) |
Module Contents¶
- exception euromod_linking.ingest.IngestError[source]¶
Inappropriate argument value (of correct type).
- euromod_linking.ingest.ingest(file_path: str, mapping, country: str | None = None) tuple[list[dict], list[str]][source]¶
Read an external model output file through a mapping spec.
Returns (records, warnings).
countryfilters rows to one country when a group derivation uses the nuts_code transform, for files covering several. Raises IngestError on structural problems.