euromod_linking.registry¶
Method registry — the named linkage methodologies.
A method is a reviewed implementation that turns external-model shocks (the canonical shock table) into a transformed EUROMOD input DataFrame plus run parameters. Methodology lives in code; a scenario can only select a method and supply scenario-semantics params validated against the method’s own params_schema.
Methods carry no version number. What guards against an edit to the modelling silently serving results computed by earlier code is code_fingerprint, which hashes a method’s own source into the scenario fingerprint — a content-derived identity that cannot be forgotten the way a hand-maintained version integer can.
Exceptions¶
Mapping key not found. |
Classes¶
A methodology's published contract: what it consumes, what it needs, and |
Functions¶
|
|
|
Content hash of the methodology's own source. |
|
|
|
|
|
The method registered under name. |
|
Dispatch: the unique registered methodology covering the given shock |
Module Contents¶
- exception euromod_linking.registry.MethodLookupError(message: str, available: list[str])[source]¶
Mapping key not found.
- available¶
- class euromod_linking.registry.MethodSpec[source]¶
A methodology’s published contract: what it consumes, what it needs, and what it does to the input.
nameis how a methodology is referred to everywhere else — in dispatch, in a scenario’smethodologypin, and in results.- factory: Callable = None¶
- euromod_linking.registry.code_fingerprint(spec: MethodSpec) str[source]¶
Content hash of the methodology’s own source.
Results are cached on the scenario fingerprint, but a scenario document does not change when the methodology does — so without this, editing a method’s modelling silently serves results computed by the earlier code. Hashing the implementation makes any code change invalidate its cached runs, the same content-addressed discipline used for shock tables and scores. Empty string if the source cannot be read, which leaves caching keyed on the methodology name alone.
- euromod_linking.registry.list_specs() list[MethodSpec][source]¶
- euromod_linking.registry.register(spec: MethodSpec) MethodSpec[source]¶
- euromod_linking.registry.resolve(name: str) MethodSpec[source]¶
The method registered under name.
- euromod_linking.registry.resolve_for_channels(channels: set[str], metrics: set[str]) MethodSpec[source]¶
Dispatch: the unique registered methodology covering the given shock channels (and metrics, where the spec constrains them). Users never select a methodology — it is resolved from the shocks and echoed in the response; an explicit scenario pin exists only for reproduction and for the day two methodologies claim the same channel.