Skip to content
Snippets Groups Projects
Commit 545f6ab7 authored by Aaron Spring's avatar Aaron Spring :baby_symbol:
Browse files

new observations after conservative regridding and groupby week

parent 8f1cf414
No related branches found
No related tags found
1 merge request!4new observations after conservative regridding and groupby week
source diff could not be displayed: it is stored in LFS. Options to address this: view the blob.
source diff could not be displayed: it is stored in LFS. Options to address this: view the blob.
...@@ -6,7 +6,7 @@ import pandas as pd ...@@ -6,7 +6,7 @@ import pandas as pd
import argparse import argparse
from pathlib import Path from pathlib import Path
def assert_predictions_2020(preds_test, exclude='weekofyear'): def assert_predictions_2020(preds_test, exclude='week'):
"""Check the variables, coordinates and dimensions of 2020 predictions.""" """Check the variables, coordinates and dimensions of 2020 predictions."""
from xarray.testing import assert_equal # doesnt care about attrs but checks coords from xarray.testing import assert_equal # doesnt care about attrs but checks coords
if isinstance(exclude, str): if isinstance(exclude, str):
...@@ -21,9 +21,9 @@ def assert_predictions_2020(preds_test, exclude='weekofyear'): ...@@ -21,9 +21,9 @@ def assert_predictions_2020(preds_test, exclude='weekofyear'):
assert 't2m' in preds_test.data_vars assert 't2m' in preds_test.data_vars
## coords ## coords
# ignore weekofyear coord if not dim # ignore week coord if not dim
if 'weekofyear' in exclude and 'weekofyear' in preds_test.coords and 'weekofyear' not in preds_test.dims: if 'week' in exclude and 'week' in preds_test.coords and 'week' not in preds_test.dims:
preds_test = preds_test.drop('weekofyear') preds_test = preds_test.drop('week')
# forecast_time # forecast_time
if 'forecast_time' not in exclude: if 'forecast_time' not in exclude:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment