Skip to content

Commit

Permalink
added warning about new temporal matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
s-scherrer committed May 19, 2021
1 parent 8f6af4a commit 3ecf84d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/pytesmo/validation_framework/metric_calculators.py
Original file line number Diff line number Diff line change
Expand Up @@ -1468,6 +1468,12 @@ class PairwiseIntercomparisonMetrics(MetadataMetrics, PairwiseMetricsMixin):
Additionally, confidence intervals for these metrics can be calculated
(optional).
**NOTE**: When using this within a
``pytesmo.validation_framework.validation.Validation``, use
``temporal_matcher=make_combined_temporal_matcher(<window>)`` as keyword
argument. ``make_combined_temporal_matcher`` can be imported from
``pytesmo.validation_framework.temporal_matchers``.
Parameters
----------
min_obs : int, optional
Expand Down Expand Up @@ -1561,6 +1567,12 @@ class TripleCollocationMetrics(MetadataMetrics, PairwiseMetricsMixin):
- error standard deviation
- linear scaling/multiplicative (first-order) bias
**NOTE**: When using this within a
``pytesmo.validation_framework.validation.Validation``, use
``temporal_matcher=make_combined_temporal_matcher(<window>)`` as keyword
argument. ``make_combined_temporal_matcher`` can be imported from
``pytesmo.validation_framework.temporal_matchers``.
Parameters
----------
refname : str
Expand Down
7 changes: 7 additions & 0 deletions src/pytesmo/validation_framework/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import numpy as np
import pandas as pd
from pygeogrids.grids import CellGrid
import warnings

from pytesmo.validation_framework.data_manager import DataManager
from pytesmo.validation_framework.data_manager import get_result_names
Expand Down Expand Up @@ -121,6 +122,12 @@ def __init__(self, datasets, spatial_ref, metrics_calculators,

self.temp_matching = temporal_matcher
if self.temp_matching is None:
warnings.warn(
"You are using the default temporal matcher. If you are using one of the"
" newer metric calculators (PairwiseIntercomparisonMetrics,"
" TripleCollocationMetrics) you should probably use `make_combined_temporal_matcher`"
" instead. Have a look at the documentation of the metric calculators for more info."
)
self.temp_matching = temporal_matchers.BasicTemporalMatching(
window=temporal_window).combinatory_matcher

Expand Down

0 comments on commit 3ecf84d

Please sign in to comment.