Examples and Python API¶
Executable examples in the test suite¶
The MET Python tests are both regression tests and executable examples of the supported installed API. They deliberately distinguish configuration construction, remote administration, and running the installed application. They do not require live MET traffic.
python/test_suites/integration/test_met_no_types.py:source. The basic type/configuration example, including finite/open periods, nested editing, optional interpolation/concat, sparse IDW overrides, member lists, and generated stub checks. It needs no private native fixture or running service.python/test_suites/integration/test_met_no_app.py:source. Installed application/subprocess/client example: actual executable help/version, foreground startup, wire readiness, inactive configuration CRUD, secret-file handling, logging, SIGTERM shutdown, and persistence after process restart. It deliberately does not activate tasks or contact MET.python/test_suites/integration/test_met_no.py:source. Wire model-version CRUD, typed status/acquisition/catalog results, asynchronous reconcile requests for ready agents, blocked/unknown agent behavior, and precise installed stub annotations. Its private native fixtures supply loopback services and controlled agent state; they are test support, not installed user APIs. Use the public client methods for deployment activation.
A selected local interpolation example comes directly from the type test:
interpolation = met_no.InterpolationConfig()
interpolation.default_parameter = IDWParameter(max_members=7, max_distance=80000)
interpolation.parameters['air_temperature_2m'] = IDWTemperatureParameter(default_gradient=-0.004)
interpolation.parameters['precipitation_amount_acc'] = IDWPrecipitationParameter(scale_factor=1.08)
Import met_no from shyft.integration and the three IDW parameter classes
from shyft.hydrology as in Configuration. For a concise remote
store/activate/status/request example, and examples of preparing a replacement
version, switching, and clearing to passive operation, use Configuration.
For already-active agents, use Request reconciliation now. Version discovery
returns an ordinary Python list of ModelInfo entries; persistent active
selections use an ordinary Python dictionary, not a custom container binding.
Run the suites through the configured CTest workflow so installed package, executable, stubs, and the private fixture paths are set correctly. For the release Clang presets in this repository:
cmake --build --preset u-bld-rel-clang -j 80 --target install
ctest --preset u-tst-rel-clang-cpp -R met_no --output-on-failure
ctest --preset u-tst-rel-clang-python -R 'python/integration/test_met_no' --output-on-failure
Installed Python API reference¶
This reference uses Sphinx’s existing live autodoc mechanism. Names,
signatures, and property descriptions come from the installed binding. Its
type: description property docstrings also generate the installed
shyft/integration/met_no.pyi; that stub provides typed configuration,
interpolation alternatives, containers, and optional/read-only result types for
Python tooling. Do not manually edit a generated stub to change the API.
For a source-tree documentation build, select the current installation before running the established Sphinx workflow (adjust the prefix for another preset):
export PYTHONPATH="$HOME/projects/shyft/build/clang/rel/_install/lib/python3.14/site-packages"
cd doc/sphinx
make html
Configuration and administration of the external MET Norway service.
- class shyft.integration.met_no.AcquisitionRecord(self: shyft.integration.met_no.AcquisitionRecord)¶
Bases:
pybind11_objectPersisted service bookkeeping; fc remains authoritative proof of data presence.
Construct an empty read-only acquisition record.
- __init__(self: shyft.integration.met_no.AcquisitionRecord) None¶
Construct an empty read-only acquisition record.
- property attempts¶
Number of acquisition attempts.
- Type:
int
- property diagnostic¶
Last acquisition diagnostic.
- Type:
str
- property forecast¶
Forecast identity (a copy).
- Type:
- property http_status¶
Last upstream HTTP status, or zero.
- Type:
int
- property status¶
Durable acquisition outcome.
- Type:
- class shyft.integration.met_no.AcquisitionStatus(self: shyft.integration.met_no.AcquisitionStatus, value: SupportsInt | SupportsIndex)¶
Bases:
pybind11_objectDurable acquisition outcome; fc data presence remains authoritative.
Members:
UNKNOWN
STORED
PERMANENTLY_UNAVAILABLE
RETRYABLE_FAILURE
- PERMANENTLY_UNAVAILABLE = <AcquisitionStatus.PERMANENTLY_UNAVAILABLE: 2>¶
- RETRYABLE_FAILURE = <AcquisitionStatus.RETRYABLE_FAILURE: 3>¶
- STORED = <AcquisitionStatus.STORED: 1>¶
- UNKNOWN = <AcquisitionStatus.UNKNOWN: 0>¶
- __init__(self: shyft.integration.met_no.AcquisitionStatus, value: SupportsInt | SupportsIndex) None¶
- AcquisitionStatus.name -> str
- property value¶
- class shyft.integration.met_no.AgentState(self: shyft.integration.met_no.AgentState, value: SupportsInt | SupportsIndex)¶
Bases:
pybind11_objectTransient acquisition agent lifecycle state.
Members:
STOPPED
RESOLVING
READY
BLOCKED
STOPPING
RECONCILING
- BLOCKED = <AgentState.BLOCKED: 3>¶
- READY = <AgentState.READY: 2>¶
- RECONCILING = <AgentState.RECONCILING: 5>¶
- RESOLVING = <AgentState.RESOLVING: 1>¶
- STOPPED = <AgentState.STOPPED: 0>¶
- STOPPING = <AgentState.STOPPING: 4>¶
- __init__(self: shyft.integration.met_no.AgentState, value: SupportsInt | SupportsIndex) None¶
- AgentState.name -> str
- property value¶
- class shyft.integration.met_no.AgentStatus(self: shyft.integration.met_no.AgentStatus)¶
Bases:
pybind11_objectTransient acquisition agent runtime snapshot; not persisted.
Construct an empty read-only agent snapshot.
- __init__(self: shyft.integration.met_no.AgentStatus) None¶
Construct an empty read-only agent snapshot.
- property cc_db¶
Resolved concat database, empty when disabled.
- Type:
str
- property completed_cycles¶
Completed reconciliation cycles.
- Type:
int
- property fc_db¶
Resolved forecast target database.
- Type:
str
- property last_diagnostic¶
Most recent agent diagnostic.
- Type:
str
- property last_reconcile_result¶
Last completed cycle summary, or None.
- Type:
Optional[ReconcileCycleResult]
- property mid¶
Active configuration model ID.
- Type:
int
- property name¶
Logical configuration name.
- Type:
str
- property state¶
Current lifecycle state.
- Type:
- class shyft.integration.met_no.CatalogDayRecord(self: shyft.integration.met_no.CatalogDayRecord)¶
Bases:
pybind11_objectDurable shared cached result for a product and one UTC catalog day.
Construct an empty read-only catalog-day record.
- __init__(self: shyft.integration.met_no.CatalogDayRecord) None¶
Construct an empty read-only catalog-day record.
- property diagnostic¶
Catalog fetch diagnostic.
- Type:
str
- property forecasts¶
Discovered forecasts (a copied list).
- Type:
List[DiscoveredForecast]
- property http_status¶
Upstream HTTP status, or zero.
- Type:
int
- property issues¶
Identity parse diagnostics (a copied list).
- Type:
List[DiscoveryIssue]
- property product¶
Cached product description (a copy).
- Type:
- property status¶
Availability or failure outcome.
- Type:
- class shyft.integration.met_no.CatalogDayStatus(self: shyft.integration.met_no.CatalogDayStatus, value: SupportsInt | SupportsIndex)¶
Bases:
pybind11_objectAvailability or failure of a cached UTC catalog day.
Members:
AVAILABLE
RETRYABLE_FAILURE
PERMANENTLY_UNAVAILABLE
- AVAILABLE = <CatalogDayStatus.AVAILABLE: 0>¶
- PERMANENTLY_UNAVAILABLE = <CatalogDayStatus.PERMANENTLY_UNAVAILABLE: 2>¶
- RETRYABLE_FAILURE = <CatalogDayStatus.RETRYABLE_FAILURE: 1>¶
- __init__(self: shyft.integration.met_no.CatalogDayStatus, value: SupportsInt | SupportsIndex) None¶
- CatalogDayStatus.name -> str
- property value¶
- class shyft.integration.met_no.Client(self: shyft.integration.met_no.Client, host_port: str, timeout_ms: SupportsInt | SupportsIndex, operation_timeout_ms: SupportsInt | SupportsIndex = 0)¶
Bases:
pybind11_objectClient/admin interface to the externally running shyft-integration-met-no service. Construction configures a connection; it does not start a service or agents. Generic model operations persist Config versions and ModelInfo metadata; runtime methods inspect or request work separately. Active-version operations persist selections and synchronously start, replace or stop agents. This wire client does not provide subscriptions or service process lifecycle operations.
Configure a client connection to an external model service; does not start the service.
- Parameters:
host_port (str) – Remote service endpoint in host:port form.
timeout_ms (int) – Connection timeout in milliseconds.
operation_timeout_ms (int) – Maximum operation/connection lifetime in milliseconds; zero disables this limit.
- __init__(self: shyft.integration.met_no.Client, host_port: str, timeout_ms: SupportsInt | SupportsIndex, operation_timeout_ms: SupportsInt | SupportsIndex = 0) None¶
Configure a client connection to an external model service; does not start the service.
- Parameters:
host_port (str) – Remote service endpoint in host:port form.
timeout_ms (int) – Connection timeout in milliseconds.
operation_timeout_ms (int) – Maximum operation/connection lifetime in milliseconds; zero disables this limit.
- clear_active_version(self: shyft.integration.met_no.Client, name: str) None¶
Make a logical configuration passive without deleting stored versions or acquired data. Remove its persistent selection and stop/join its agent before returning; repeated calls are safe.
- Parameters:
name (str) – Logical configuration name; an unselected or unknown name is safe.
- Returns:
nothing. Selection cleared and any existing agent stopped and removed.
- Return type:
None
- close(self: shyft.integration.met_no.Client) None¶
Close the connection. It will automatically reopen if needed.
- get_acquisition_state(self: shyft.integration.met_no.Client, mid: SupportsInt | SupportsIndex, id: shyft.integration.met_no.ForecastId) shyft.integration.met_no.AcquisitionRecord | None¶
Read persisted acquisition bookkeeping; fc data presence remains authoritative.
- Parameters:
mid (int) – Configuration model ID.
id (ForecastId) – Forecast run/member identity.
- Returns:
record. Record, or None when absent.
- Return type:
Optional[AcquisitionRecord]
- get_active_version(self: shyft.integration.met_no.Client, name: str) int | None¶
Query the persistent selected mid, independently of transient agent status.
- Parameters:
name (str) – Logical configuration name.
- Returns:
mid. Selected version ID, or None when the logical configuration is passive.
- Return type:
Optional[int]
- get_active_versions(self: shyft.integration.met_no.Client) dict[str, int]¶
Query the service-wide persistent logical-name to active-mid mappings, even when stopped.
- Returns:
selections. Persistent selected versions; not derived from running agents.
- Return type:
Dict[str, int]
- get_agent_status(self: shyft.integration.met_no.Client, name: str) shyft.integration.met_no.AgentStatus | None¶
Query one logical configuration’s transient agent status.
- Parameters:
name (str) – Logical configuration name.
- Returns:
status. Snapshot, or None if no agent exists.
- Return type:
Optional[AgentStatus]
- get_catalog_day(self: shyft.integration.met_no.Client, product: shyft.integration.met_no.ForecastProduct, day_start: shyft.time_series.time) shyft.integration.met_no.CatalogDayRecord | None¶
Read one cached UTC catalog day without triggering upstream discovery.
- Parameters:
product (ForecastProduct) – Catalog product.
day_start (time) – UTC catalog day start.
- Returns:
record. Cached record, or None when absent.
- Return type:
Optional[CatalogDayRecord]
- get_model_infos(self: shyft.integration.met_no.Client, mids: collections.abc.Sequence[SupportsInt | SupportsIndex], created_in: shyft.time_series.UtcPeriod = UtcPeriod()) list[shyft.time_series.ModelInfo]¶
Return all or selected model metadata, optionally filtered by creation time.
- get_status(self: shyft.integration.met_no.Client) shyft.integration.met_no.ServiceStatus¶
Query the transient service-wide runtime snapshot.
- Returns:
status. Current service status.
- Return type:
- get_versions(self: shyft.integration.met_no.Client, name: str) list[shyft.time_series.ModelInfo]¶
List stored configuration versions sharing the same logical ModelInfo.name.
- Parameters:
name (str) – Logical configuration name.
- Returns:
versions. Stored versions ordered by creation time, then model ID.
- Return type:
List[ModelInfo]
- property host_port¶
Endpoint network address of the remote server.
- Type:
str
- property is_open¶
If the connection to the remote server is (still) open.
- Type:
bool
- property operation_timeout_ms¶
Maximum operation/connection lifetime in milliseconds; zero disables this limit.
- Type:
int
- read_model(self: shyft.integration.met_no.Client, mid: SupportsInt | SupportsIndex) shyft.integration.met_no.Config¶
Read and return the model for specified model-identifier (mid)
- Parameters:
mid (int) – the model-identifer for the wanted model
- Returns:
The resulting model from the server
- Return type:
- read_models(self: shyft.integration.met_no.Client, mids: collections.abc.Sequence[SupportsInt | SupportsIndex]) list[shyft.integration.met_no.Config]¶
Read models in the specified model-identifier order.
- Parameters:
mids (List[int]) – Non-empty list of model identifiers to read.
- Returns:
The resulting models from the server
- Return type:
List[Config]
- property reconnect_count¶
Number of reconnects to the remote server that have been performed.
- Type:
int
- remove_model(self: shyft.integration.met_no.Client, mid: SupportsInt | SupportsIndex) int¶
Remove the specified persistent model and its metadata.
- Parameters:
mid (int) – the model-identifer for the wanted model
- Returns:
ec. Zero on success; service failures raise an exception.
- Return type:
int
- request_reconcile(self: shyft.integration.met_no.Client, name: str) None¶
Request/wake coalesced asynchronous reconciliation; does not wait for completion. Query status separately.
- Parameters:
name (str) – Existing running agent’s logical configuration name.
- Returns:
nothing. Request acknowledged, not reconciliation completed.
- Return type:
None
- set_active_version(self: shyft.integration.met_no.Client, name: str, mid: SupportsInt | SupportsIndex) None¶
Persist a version selection; start or replace its agent when the service manager is running. The version must exist and its ModelInfo.name must match. Selecting the same mid does not restart it.
- Parameters:
name (str) – Logical configuration name.
mid (int) – Exact stored configuration version ID.
- Returns:
nothing. Selection and any agent replacement have completed.
- Return type:
None
- store_model(self: shyft.integration.met_no.Client, m: shyft.integration.met_no.Config, mi: shyft.time_series.ModelInfo) int¶
Store the model to backend, if m.id==0 then a new unique model-info is created and used
- property timeout_ms¶
Connection timeout in milliseconds.
- Type:
int
- update_model_info(self: shyft.integration.met_no.Client, mid: SupportsInt | SupportsIndex, mi: shyft.time_series.ModelInfo) bool¶
Update the model-info for specified model-identifier(mid)
- Parameters:
mid (int) – model-identifer
mi (ModelInfo) – The new updated model-info
- Returns:
ok. true if success
- Return type:
bool
- class shyft.integration.met_no.ConcatConfig(self: shyft.integration.met_no.ConcatConfig)¶
Bases:
pybind11_objectSelects the valid-time slice and source members written from fc to cc.
Construct an empty concatenation configuration.
- __init__(self: shyft.integration.met_no.ConcatConfig) None¶
Construct an empty concatenation configuration.
- property cc_db¶
Concatenated geo database; must already exist and be appropriately anchored.
- Type:
str
- property ensembles¶
Empty selects all forecast members; otherwise source member indices. Read as a copy, assign to replace.
- Type:
List[int]
- property forecast_offset¶
Duration omitted from the beginning of each forecast, in seconds.
- Type:
- class shyft.integration.met_no.Config(self: shyft.integration.met_no.Config)¶
Bases:
pybind11_objectPersistent desired configuration for one MET acquisition task; versions use ModelInfo metadata.
Construct an unassigned configuration; configure period, product, extraction and target before storing.
- __init__(self: shyft.integration.met_no.Config) None¶
Construct an unassigned configuration; configure period, product, extraction and target before storing.
- property concat¶
Editable concatenation settings; None disables cc production.
- Type:
Optional[ConcatConfig]
- property extraction¶
Extraction/forcing policy, editable in place.
- Type:
- property id¶
Persistent model ID; zero requests a new ID when stored.
- Type:
int
- property interpolation¶
Editable interpolation settings; None requires source geometry compatible with fc.
- Type:
Optional[InterpolationConfig]
- property period¶
Forecast-reference-time interval [start,end); max_utctime supports indefinite operational collection.
- Type:
- property product¶
MET forecast product description, editable in place.
- Type:
- property source_buffer_distance¶
Acquisition geometry buffer in metres, independent of interpolation parameter radius.
- Type:
float
- property target¶
Pre-existing authoritative forecast target, editable in place.
- Type:
- class shyft.integration.met_no.DiscoveredForecast(self: shyft.integration.met_no.DiscoveredForecast)¶
Bases:
pybind11_objectCanonical forecast identity and its catalog metadata.
Construct an empty read-only discovered forecast.
- __init__(self: shyft.integration.met_no.DiscoveredForecast) None¶
Construct an empty read-only discovered forecast.
- property id¶
Canonical identity (a copy).
- Type:
- property item¶
Catalog metadata.
- Type:
- class shyft.integration.met_no.DiscoveryIssue(self: shyft.integration.met_no.DiscoveryIssue)¶
Bases:
pybind11_objectDiagnostic encountered while discovering a UTC day catalog.
Construct an empty read-only discovery diagnostic.
- __init__(self: shyft.integration.met_no.DiscoveryIssue) None¶
Construct an empty read-only discovery diagnostic.
- property diagnostic¶
Discovery diagnostic.
- Type:
str
- property http_status¶
Upstream HTTP status, or zero.
- Type:
int
- class shyft.integration.met_no.DtssGeoTarget(self: shyft.integration.met_no.DtssGeoTarget)¶
Bases:
pybind11_objectReferences pre-existing authoritative DTSS geo databases; does not create them.
Construct an empty target; set DTSS endpoints and the forecast database before storing.
- __init__(self: shyft.integration.met_no.DtssGeoTarget) None¶
Construct an empty target; set DTSS endpoints and the forecast database before storing.
- property fc_db¶
Forecast geo database, which must already exist and defines authoritative target geometry.
- Type:
str
- property host_ports¶
port endpoints; read as a copy, assign to replace.
- Type:
List[str]
- Type:
DTSS host
- class shyft.integration.met_no.ElevationMode(self: shyft.integration.met_no.ElevationMode, value: SupportsInt | SupportsIndex)¶
Bases:
pybind11_objectSource geopotential supplies elevation; EXTERNAL_LATER is not implemented.
Members:
SOURCE_GEOPOTENTIAL
EXTERNAL_LATER
- EXTERNAL_LATER = <ElevationMode.EXTERNAL_LATER: 1>¶
- SOURCE_GEOPOTENTIAL = <ElevationMode.SOURCE_GEOPOTENTIAL: 0>¶
- __init__(self: shyft.integration.met_no.ElevationMode, value: SupportsInt | SupportsIndex) None¶
- ElevationMode.name -> str
- property value¶
- class shyft.integration.met_no.ExtractionPolicy(self: shyft.integration.met_no.ExtractionPolicy)¶
Bases:
pybind11_objectVariables and source geometry/elevation required for forecast extraction.
Construct a source-geometry policy with no variables selected.
- __init__(self: shyft.integration.met_no.ExtractionPolicy) None¶
Construct a source-geometry policy with no variables selected.
- property elevation¶
Elevation source policy.
- Type:
- property geometry¶
Source geometry inclusion policy.
- Type:
- property variables¶
Mutable extracted variable configurations.
- Type:
- class shyft.integration.met_no.ForecastId(*args, **kwargs)¶
Bases:
pybind11_objectStable logical identity of one MET forecast run/member.
Overloaded function.
__init__(self: shyft.integration.met_no.ForecastId) -> None
Construct an empty identity.
__init__(self: shyft.integration.met_no.ForecastId, product: str, reference_time: shyft.time_series.time, member: typing.SupportsInt | typing.SupportsIndex | None = None) -> None
Construct a product/run identity; member is None for deterministic forecasts.
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: shyft.integration.met_no.ForecastId) -> None
Construct an empty identity.
__init__(self: shyft.integration.met_no.ForecastId, product: str, reference_time: shyft.time_series.time, member: typing.SupportsInt | typing.SupportsIndex | None = None) -> None
Construct a product/run identity; member is None for deterministic forecasts.
- property member¶
Ensemble member, or None for deterministic forecasts.
- Type:
Optional[int]
- property product¶
Forecast product name.
- Type:
str
- class shyft.integration.met_no.ForecastItem(self: shyft.integration.met_no.ForecastItem)¶
Bases:
pybind11_objectCatalog metadata for one discovered forecast dataset.
Construct empty read-only catalog metadata.
- __init__(self: shyft.integration.met_no.ForecastItem) None¶
Construct empty read-only catalog metadata.
- property dataset_url¶
Forecast dataset URL.
- Type:
str
- property geometry_dataset_url¶
Source geometry dataset URL.
- Type:
str
- property geometry_url_path¶
Source geometry catalog path.
- Type:
str
- property kind¶
Deterministic or member dataset.
- Type:
- property member¶
Source ensemble member index.
- Type:
Optional[int]
- property product¶
Forecast product name.
- Type:
str
- property run_time¶
MET run timestamp, for example 20260616T03Z.
- Type:
str
- property url_path¶
Catalog-relative dataset path.
- Type:
str
- class shyft.integration.met_no.ForecastKind(self: shyft.integration.met_no.ForecastKind, value: SupportsInt | SupportsIndex)¶
Bases:
pybind11_objectDeterministic run or individual ensemble member.
Members:
DETERMINISTIC
ENSEMBLE_MEMBER
- DETERMINISTIC = <ForecastKind.DETERMINISTIC: 0>¶
- ENSEMBLE_MEMBER = <ForecastKind.ENSEMBLE_MEMBER: 1>¶
- __init__(self: shyft.integration.met_no.ForecastKind, value: SupportsInt | SupportsIndex) None¶
- ForecastKind.name -> str
- property value¶
- class shyft.integration.met_no.ForecastProduct(self: shyft.integration.met_no.ForecastProduct)¶
Bases:
pybind11_objectMET catalog product and archive naming.
Construct the default deterministic MEPS surface product.
- __init__(self: shyft.integration.met_no.ForecastProduct) None¶
Construct the default deterministic MEPS surface product.
- property archive_root¶
THREDDS archive root.
- Type:
str
- property extension¶
Catalog dataset file extension.
- Type:
str
- property name¶
Product name, for example meps_det_sfc.
- Type:
str
- class shyft.integration.met_no.GeometryMode(self: shyft.integration.met_no.GeometryMode, value: SupportsInt | SupportsIndex)¶
Bases:
pybind11_objectWhether extraction includes source longitude, latitude and geopotential.
Members:
NONE
INCLUDE_SOURCE
- INCLUDE_SOURCE = <GeometryMode.INCLUDE_SOURCE: 1>¶
- NONE = <GeometryMode.NONE: 0>¶
- __init__(self: shyft.integration.met_no.GeometryMode, value: SupportsInt | SupportsIndex) None¶
- GeometryMode.name -> str
- property value¶
- class shyft.integration.met_no.InterpolationConfig(self: shyft.integration.met_no.InterpolationConfig)¶
Bases:
pybind11_objectDefault spatial interpolation parameters with sparse per-variable overrides.
Construct generic IDW defaults with no variable overrides.
- __init__(self: shyft.integration.met_no.InterpolationConfig) None¶
Construct generic IDW defaults with no variable overrides.
- property default_parameter¶
Default hydrology IDW parameter when no exact variable override exists.
- Type:
Union[IDWParameter, IDWTemperatureParameter, IDWPrecipitationParameter]
- parameter_for(self: shyft.integration.met_no.InterpolationConfig, variable: str) shyft.hydrology.IDWParameter | shyft.hydrology.IDWTemperatureParameter | shyft.hydrology.IDWPrecipitationParameter¶
Return the exact variable override, or default_parameter.
- Parameters:
variable (str) – Extracted MET variable name.
- Returns:
parameter. Selected spatial interpolation parameter.
- Return type:
Union[IDWParameter, IDWTemperatureParameter, IDWPrecipitationParameter]
- property parameters¶
Mutable sparse overrides keyed by extracted MET variable name.
- class shyft.integration.met_no.InterpolationParameterMap(*args, **kwargs)¶
Bases:
pybind11_objectMutable mapping from MET variable name to a hydrology IDW parameter.
Overloaded function.
__init__(self: shyft.integration.met_no.InterpolationParameterMap) -> None
__init__(self: shyft.integration.met_no.InterpolationParameterMap, arg0: shyft.integration.met_no.InterpolationParameterMap) -> None
CopyConstructor
__init__(self: shyft.integration.met_no.InterpolationParameterMap, items: collections.abc.Sequence[tuple[str, shyft.hydrology.IDWParameter | shyft.hydrology.IDWTemperatureParameter | shyft.hydrology.IDWPrecipitationParameter]]) -> None
Construct from (variable name, IDW parameter) pairs.
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: shyft.integration.met_no.InterpolationParameterMap) -> None
__init__(self: shyft.integration.met_no.InterpolationParameterMap, arg0: shyft.integration.met_no.InterpolationParameterMap) -> None
CopyConstructor
__init__(self: shyft.integration.met_no.InterpolationParameterMap, items: collections.abc.Sequence[tuple[str, shyft.hydrology.IDWParameter | shyft.hydrology.IDWTemperatureParameter | shyft.hydrology.IDWPrecipitationParameter]]) -> None
Construct from (variable name, IDW parameter) pairs.
- get(self: shyft.integration.met_no.InterpolationParameterMap, key: str, default: shyft.hydrology.IDWParameter | shyft.hydrology.IDWTemperatureParameter | shyft.hydrology.IDWPrecipitationParameter | None = None) shyft.hydrology.IDWParameter | shyft.hydrology.IDWTemperatureParameter | shyft.hydrology.IDWPrecipitationParameter | None¶
Return the value for key if key is in the dictionary, else default.
- items(self: shyft.integration.met_no.InterpolationParameterMap) shyft.energy_market.ItemsView¶
- keys(self: shyft.integration.met_no.InterpolationParameterMap) shyft.energy_market.KeysView¶
- values(self: shyft.integration.met_no.InterpolationParameterMap) shyft.energy_market.ValuesView¶
- class shyft.integration.met_no.ReconcileCycleIssue(self: shyft.integration.met_no.ReconcileCycleIssue)¶
Bases:
pybind11_objectTransient diagnostic from one reconciliation stage; not persisted.
Construct an empty read-only reconciliation diagnostic.
- __init__(self: shyft.integration.met_no.ReconcileCycleIssue) None¶
Construct an empty read-only reconciliation diagnostic.
- property diagnostic¶
Stage diagnostic.
- Type:
str
- property forecast¶
Affected forecast identity (a copy), if known.
- Type:
Optional[ForecastId]
- property http_status¶
Upstream HTTP status, or zero.
- Type:
int
- property stage¶
Stage reporting this issue.
- Type:
- class shyft.integration.met_no.ReconcileCycleResult(self: shyft.integration.met_no.ReconcileCycleResult)¶
Bases:
pybind11_objectTransient summary of one service reconciliation cycle; not persisted.
Construct an empty read-only cycle summary.
- __init__(self: shyft.integration.met_no.ReconcileCycleResult) None¶
Construct an empty read-only cycle summary.
- property acquired¶
Successfully acquired forecasts.
- Type:
int
- property acquisition_failed¶
Failed acquisition attempts.
- Type:
int
- property cancelled¶
Whether the cycle was cancelled.
- Type:
bool
- property complete_before¶
Forecasts already complete in fc before the cycle.
- Type:
int
- property concat_attempted¶
Concatenation attempts.
- Type:
int
- property concat_failed¶
Failed concatenations.
- Type:
int
- property concat_stored¶
Successful concatenations.
- Type:
int
- property deferred¶
Forecasts deferred until a later retry.
- Type:
int
- property discovered¶
Discovered forecast count.
- Type:
int
- property discovery_issues¶
Discovery diagnostic count.
- Type:
int
- property issues¶
Cycle diagnostics (a copied list).
- Type:
List[ReconcileCycleIssue]
- property planned_acquire¶
Forecasts planned for acquisition.
- Type:
int
Permanently unavailable forecasts.
- Type:
int
- class shyft.integration.met_no.ReconcileStage(self: shyft.integration.met_no.ReconcileStage, value: SupportsInt | SupportsIndex)¶
Bases:
pybind11_objectStage reporting a reconciliation diagnostic.
Members:
DISCOVERY
ACQUISITION
CONCAT
- ACQUISITION = <ReconcileStage.ACQUISITION: 1>¶
- CONCAT = <ReconcileStage.CONCAT: 2>¶
- DISCOVERY = <ReconcileStage.DISCOVERY: 0>¶
- __init__(self: shyft.integration.met_no.ReconcileStage, value: SupportsInt | SupportsIndex) None¶
- ReconcileStage.name -> str
- property value¶
- class shyft.integration.met_no.ServiceStatus(self: shyft.integration.met_no.ServiceStatus)¶
Bases:
pybind11_objectTransient service-wide runtime snapshot; not persisted.
Construct an empty read-only service snapshot.
- __init__(self: shyft.integration.met_no.ServiceStatus) None¶
Construct an empty read-only service snapshot.
- property agents¶
Agents ordered by logical configuration name (a copied list).
- Type:
List[AgentStatus]
- property running¶
Whether the service manager is running.
- Type:
bool
- class shyft.integration.met_no.SourceConversionPolicy(self: shyft.integration.met_no.SourceConversionPolicy, value: SupportsInt | SupportsIndex)¶
Bases:
pybind11_objectConversion of source samples to Shyft interval values or rates.
Members:
SAMPLE_AND_HOLD_TO_AVERAGE
ACCUMULATED_TO_RATE
NO_CONVERT
- ACCUMULATED_TO_RATE = <SourceConversionPolicy.ACCUMULATED_TO_RATE: 1>¶
- NO_CONVERT = <SourceConversionPolicy.NO_CONVERT: 2>¶
- SAMPLE_AND_HOLD_TO_AVERAGE = <SourceConversionPolicy.SAMPLE_AND_HOLD_TO_AVERAGE: 0>¶
- __init__(self: shyft.integration.met_no.SourceConversionPolicy, value: SupportsInt | SupportsIndex) None¶
- SourceConversionPolicy.name -> str
- property value¶
- class shyft.integration.met_no.VariableConfig(self: shyft.integration.met_no.VariableConfig)¶
Bases:
pybind11_objectExtraction, missing-value and unit conversion configuration for one MET variable.
Construct an unnamed variable with sample-and-hold conversion.
- __init__(self: shyft.integration.met_no.VariableConfig) None¶
Construct an unnamed variable with sample-and-hold conversion.
- property conversion¶
Source sample conversion.
- Type:
- property fill_value¶
Source missing-value marker, or None.
- Type:
Optional[float]
- property name¶
Extracted MET variable name; also the interpolation override key.
- Type:
str
- property offset¶
Offset added after scaling source values.
- Type:
float
- property scale¶
Multiplier applied to valid source values.
- Type:
float
- class shyft.integration.met_no.VariableConfigVector(*args, **kwargs)¶
Bases:
pybind11_objectMutable sequence of extracted variable configurations; accepts Python iterables.
Overloaded function.
__init__(self: shyft.integration.met_no.VariableConfigVector) -> None
__init__(self: shyft.integration.met_no.VariableConfigVector, arg0: shyft.integration.met_no.VariableConfigVector) -> None
Copy constructor
__init__(self: shyft.integration.met_no.VariableConfigVector, arg0: collections.abc.Iterable) -> None
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: shyft.integration.met_no.VariableConfigVector) -> None
__init__(self: shyft.integration.met_no.VariableConfigVector, arg0: shyft.integration.met_no.VariableConfigVector) -> None
Copy constructor
__init__(self: shyft.integration.met_no.VariableConfigVector, arg0: collections.abc.Iterable) -> None
- append(self: shyft.integration.met_no.VariableConfigVector, x: shyft.integration.met_no.VariableConfig) None¶
Add an item to the end of the list
- clear(self: shyft.integration.met_no.VariableConfigVector) None¶
Clear the contents
- extend(*args, **kwargs)¶
Overloaded function.
extend(self: shyft.integration.met_no.VariableConfigVector, L: shyft.integration.met_no.VariableConfigVector) -> None
Extend the list by appending all the items in the given list
extend(self: shyft.integration.met_no.VariableConfigVector, L: collections.abc.Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.integration.met_no.VariableConfigVector, i: SupportsInt | SupportsIndex, x: shyft.integration.met_no.VariableConfig) None¶
Insert an item at a given position.
- pop(*args, **kwargs)¶
Overloaded function.
pop(self: shyft.integration.met_no.VariableConfigVector) -> shyft.integration.met_no.VariableConfig
Remove and return the last item
pop(self: shyft.integration.met_no.VariableConfigVector, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.integration.met_no.VariableConfig
Remove and return the item at index
i
- size(self: shyft.integration.met_no.VariableConfigVector) int¶