dpyverification.constants#

Collection of constant values definitions.

Both single values, and enum classes. These values are can be used throughout DPyVerification.

Classes

DataSinkKind(value)

Enumeration of the supported datasink types.

DataSourceKind(value)

Enumeration of the supported datasource types.

DataType(value)

Input timeseries data kind.

ScoreKind(value)

Enumeration of the implemented verification scores.

StandardAttribute()

List of attribute names on the main xarray.

StandardCoord()

List of coordinate names and attributes.

StandardDim(value)

List of dimension names.

SupportedCategoricalScores(value)

The supported categorical scores.

SupportedContinuousScore(value)

Supported continuous scores.

TimeUnits(value)

Time unit strings, compatible with numpy datetime64 and timedelta64.

class dpyverification.constants.DataSourceKind(value)[source]#

Enumeration of the supported datasource types.

FEWSNETCDF = 'fewsnetcdf'#
FEWSWEBSERVICE = 'fewswebservice'#
CSV = 'csv'#
NETCDF = 'netcdf'#
class dpyverification.constants.DataSinkKind(value)[source]#

Enumeration of the supported datasink types.

fews_netcdf = 'fewsnetcdf'#
cf_compliant_netcdf = 'cf_compliant_netcdf'#
class dpyverification.constants.DataType(value)[source]#

Input timeseries data kind.

observed_historical = 'observed_historical'#
simulated_historical = 'simulated_historical'#
simulated_forecast_single = 'simulated_forecast_single'#
simulated_forecast_ensemble = 'simulated_forecast_ensemble'#
simulated_forecast_probabilistic = 'simulated_forecast_probabilistic'#
threshold = 'threshold'#
class dpyverification.constants.ScoreKind(value)[source]#

Enumeration of the implemented verification scores.

rank_histogram = 'rank_histogram'#
crps_for_ensemble = 'crps_for_ensemble'#
crps_cdf = 'crps_cdf'#
continuous_scores = 'continuous_scores'#
categorical_scores = 'categorical_scores'#
class dpyverification.constants.SupportedContinuousScore(value)[source]#

Supported continuous scores.

additive_bias = 'additive_bias'#
mean_error = 'mean_error'#
mae = 'mae'#
mse = 'mse'#
rmse = 'rmse'#
nse = 'nse'#
kge = 'kge'#
class dpyverification.constants.SupportedCategoricalScores(value)[source]#

The supported categorical scores.

Explicitly excluded scores - gilberts_skill_score (identical to equitable_threat_score) - threat_score (identical to critical_success_index) - heidke_skill_score (identical to cohens_kappa) - frequency_bias (identical to bias score) - fraction_correct (identical to accuracy) - hanssen_and_kuipers_discriminant (identical to peirce_skill_score) - true_skill_statistic (identical to peirce_skill_score) - yules_q (identical to odds_ratio_skill_score) - positive_predictive_value (identical to precision) - success_ratio (identical to precision) - probability_of_detection (identical to hit_rate) - true_positive_rate (identical to hit rate) - sensitivity (identical to hit rate) - recall (identical to hit rate) - true_negative_rate (identical to specificity) - probability of false detection (identical to false alarm rate)

accuracy = 'accuracy'#
base_rate = 'base_rate'#
bias_score = 'bias_score'#
cohens_kappa = 'cohens_kappa'#
critical_success_index = 'critical_success_index'#
equitable_threat_score = 'equitable_threat_score'#
f1_score = 'f1_score'#
false_alarm_rate = 'false_alarm_rate'#
false_alarm_ratio = 'false_alarm_ratio'#
forecast_rate = 'forecast_rate'#
peirce_skill_score = 'peirce_skill_score'#
hit_rate = 'hit_rate'#
negative_predictive_value = 'negative_predictive_value'#
odds_ratio = 'odds_ratio'#
odds_ratio_skill_score = 'odds_ratio_skill_score'#
precision = 'precision'#
specificity = 'specificity'#
symmetric_extremal_dependence_index = 'symmetric_extremal_dependence_index'#
class dpyverification.constants.TimeUnits(value)[source]#

Time unit strings, compatible with numpy datetime64 and timedelta64.

year = 'Y'#
month = 'M'#
week = 'W'#
day = 'D'#
hour = 'h'#
minute = 'm'#
second = 's'#
class dpyverification.constants.StandardDim(value)[source]#

List of dimension names.

To avoid hardcoded strings in multiple places, have a single list with the names of known dimensions.

time = 'time'#
station = 'station'#
realization = 'realization'#
forecast_reference_time = 'forecast_reference_time'#
forecast_period = 'forecast_period'#
variable = 'variable'#
threshold = 'threshold'#
class dpyverification.constants.StandardCoord[source]#

List of coordinate names and attributes.

To avoid hardcoded strings in multiple places, have a single list with the names of known coordinates, and their known attributes. At the very least the attributes needed for the coordinates to be CF compliant are included in the attributes info.

Coordinates with matching dimension will have the same name as the dimension

class CoordinateProperties(name, attributes)[source]#

Collect name and known attributes of coordinate in one object.

Parameters:
name: str#
attributes: tuple[tuple[str, str], ...]#
time = StandardCoord.CoordinateProperties(name=<StandardDim.time: 'time'>, attributes=(('standard_name', 'time'), ('long_name', 'time'), ('axis', 'T')))#
station = StandardCoord.CoordinateProperties(name='station', attributes=(('long_name', 'station identification code'), ('cf_role', 'timeseries_id')))#
station_name = StandardCoord.CoordinateProperties(name='station_name', attributes=(('long_name', 'station name'),))#
lat = StandardCoord.CoordinateProperties(name='lat', attributes=(('standard_name', 'latitude'), ('long_name', 'Station coordinates, latitude'), ('units', 'degrees_north'), ('axis', 'Y')))#
lon = StandardCoord.CoordinateProperties(name='lon', attributes=(('standard_name', 'longitude'), ('long_name', 'Station coordinates, longitude'), ('units', 'degrees_east'), ('axis', 'X')))#
x = StandardCoord.CoordinateProperties(name='x', attributes=(('standard_name', 'projection_x_coordinate'), ('long_name', 'x coordinate according to WGS 1984'), ('units', 'degrees'), ('axis', 'X')))#
y = StandardCoord.CoordinateProperties(name='x', attributes=(('standard_name', 'projection_y_coordinate'), ('long_name', 'y coordinate according to WGS 1984'), ('units', 'degrees'), ('axis', 'Y')))#
z = StandardCoord.CoordinateProperties(name='z', attributes=(('standard_name', 'projection_z_coordinate'), ('long_name', 'z coordinate according to WGS 1984'), ('units', 'degrees'), ('axis', 'Z')))#
realization = StandardCoord.CoordinateProperties(name=<StandardDim.realization: 'realization'>, attributes=(('standard_name', 'realization'), ('long_name', 'Index of an ensemble member within an ensemble'), ('units', '1')))#
forecast_reference_time = StandardCoord.CoordinateProperties(name=<StandardDim.forecast_reference_time: 'forecast_reference_time'>, attributes=(('standard_name', 'forecast_reference_time'), ('long_name', 'forecast_reference_time')))#
forecast_period = StandardCoord.CoordinateProperties(name=<StandardDim.forecast_period: 'forecast_period'>, attributes=(('standard_name', 'forecast_period'), ('long_name', 'forecast_period')))#
variable = StandardCoord.CoordinateProperties(name=<StandardDim.variable: 'variable'>, attributes=(('long_name', 'simulation_or_observation_kind'),))#
units = StandardCoord.CoordinateProperties(name='units', attributes=(('long_name', 'units'),))#
class dpyverification.constants.StandardAttribute[source]#

List of attribute names on the main xarray.

To avoid hardcoded strings in multiple places, have a single list with the names of known attributes.

source = 'source'#
timestep = 'timestep'#
featuretype = 'featureType'#