dpyverification.datamodel.main#

Module with the dpyverification internal DataModel.

Classes

InputDataset(data)

Class containing simulations and observations.

OutputDataset(input_dataset)

The internal output dataset.

class dpyverification.datamodel.main.InputDataset(data)[source]#

Class containing simulations and observations.

SimObsDataset has functionality to retrieve verification pairs for computation of scores per pair. It is the central object used in the verification pipeline.

Parameters:

data (Iterable[DataArray])

static map_historical_into_forecast_space(obs, sim)[source]#

Transform array of historical data into forecast structure.

Given an observation array with dimension ‘time’ and a simulation array with dimensions ‘forecast_reference_time’ and ‘forecast_period’, project the observed values onto the simulation array.

This method is called at runtime when the pipeline starts a score computation on forecast data. On the fly, the observation array is mapped to the forecast structure, so data are aligned along the same dimensions.

Parameters:
Return type:

DataArray

get_pair(verification_pair)[source]#

Return observations and simulations for a given verification pair.

This method is called by the verification pipeline at runtime to retrieve the correct data for one of the configured verification pairs.

Parameters:

verification_pair (VerificationPair)

Return type:

tuple[DataArray, DataArray]

get_thresholds_array()[source]#

Get the thresholds array from the input dataset.

Return type:

DataArray

class dpyverification.datamodel.main.OutputDataset(input_dataset)[source]#

The internal output dataset.

Contains input data, results from verification scores and metadata.

Parameters:

input_dataset (InputDataset)

add_score(score, verification_pair_id)[source]#

Add a score results to the datastore.

Parameters:
Return type:

None

get_output_dataset(verification_pair, *, include_input_data=True)[source]#

Get the output dataset for a given verification pair.

Parameters:
  • verification_pair (VerificationPair)

  • include_input_data (bool)

Return type:

Dataset