dpyverification.scores.base#

An abstract implementation of a calculation.

Classes

BaseScore(config)

An abstract calculation class.

BaseScoreConfig(*, score_adapter, general[, ...])

Base config for a score config.

class dpyverification.scores.base.BaseScore(config)[source]#

An abstract calculation class.

Parameters:

config (BaseScoreConfig)

kind: str = ''#
config_class#

alias of BaseScoreConfig

supported_data_types: ClassVar[set[DataType]] = {}#
abstractmethod compute(obs, sim)[source]#

Abstract calculation.

Parameters:
Return type:

DataArray | Dataset

validate_and_compute(obs, sim)[source]#

Validate and compute.

Parameters:
Return type:

DataArray | Dataset

class dpyverification.scores.base.BaseScoreConfig(*, score_adapter, general, verification_pair_ids=[], **extra_data)[source]#

Base config for a score config.

Specific config definitions should inherit from this base class.

Parameters:
score_adapter: str#
general: Annotated[GeneralInfoConfig, SkipJsonSchema()]#
verification_pair_ids: Annotated[list[str], FieldInfo(annotation=NoneType, required=True, description='Optional field to select verification_pairs from the general configuration, by providing a list of verification pair ids from the general config. Only these pair ids will be used in the computation of this score.')]#
property verification_pairs: list[VerificationPair]#

The configured variable pairs.

If the verification_pairs element is configured for the score, filter only these ids from the verification_pairs defined in general config.

property forecast_periods: ForecastPeriods#
verification_pair_ids_valid()[source]#

Check provided filter for verification pairs contains valid ids.

Return type:

Self