pytesmo.validation_framework.metric_calculators_adapters module

Metric Calculator Adapters change how metrics are calculated by calling the calc_metric function of the adapted calculator instead of the unadapted version.

class pytesmo.validation_framework.metric_calculators_adapters.MonthsMetricsAdapter(calculator, month_subsets=None, group_results='tuple')[source]

Bases: SubsetsMetricsAdapter

Adapt MetricCalculators to calculate metrics for groups across months

class pytesmo.validation_framework.metric_calculators_adapters.SubsetsMetricsAdapter(calculator, subsets, group_results='tuple')[source]

Bases: object

Adapt MetricCalculators to calculate metrics for groups of temporal subsets (also across multiple years).

calc_metrics(data, gpi_info)[source]

Calculates the desired statistics, for each set that was defined.

Parameters:
  • data (pandas.DataFrame) – with 2 columns, the first column is the reference dataset named ‘ref’ the second column the dataset to compare against named ‘other’

  • gpi_info (tuple) – Grid point info (i.e. gpi, lon, lat)

pytesmo.validation_framework.metric_calculators_adapters.days_in_month(month: int) int[source]

Get number of days in this month (in a LEAP YEAR)