openghg_inversions.rhime.materialization#

Explicit eager boundaries between labelled RHIME inputs and model backends.

openghg_inversions.rhime.materialization.materialize_pymc_inputs(prepared: RhimePreparedInputs, *, variable_names: Collection[str]) Dataset#

Materialize related PyMC arrays together without mutating preparation.

variable_names comes from the concrete recipe and its selected components. Sparse chunk payloads are converted with to_dense(); those arrays and their lazy auxiliary coordinates are computed in one shared Dask operation and installed in a shallow dataset copy. Unselected prepared products and the canonical prepared artifact remain unchanged.

Parameters:
  • prepared – Borrowed backend-neutral prepared inputs.

  • variable_names – Names selected by the concrete recipe and its active components.

Returns:

A shallow dataset copy in which selected arrays and their lazy coordinates have been materialized together.

Raises:

ValueError – If a selected variable is absent from the prepared data.