Skip to content

Commit

Permalink
try more loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed Sep 5, 2024
1 parent b9ea150 commit 0993a40
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions tests/test_file_namers.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def test_StandardFileNamer_cmip5(mini_esgf_data):
mini_esgf_data["CMIP5_TAS"],
use_cftime=True,
combine="by_coords",
)
).load()

checks = [(_ds, "tas_mon_HadGEM2-ES_rcp85_r1i1p1_20051216-22991216.nc")]

Expand All @@ -91,7 +91,7 @@ def test_StandardFileNamer_cmip5_use_default_attr_names(mini_esgf_data):
mini_esgf_data["CMIP5_TAS"],
use_cftime=True,
combine="by_coords",
)
).load()

checks = [(_ds, "tas_mon_no-model_rcp85_r1i1p1_20051216-22991216.nc")]
del _ds.attrs["model_id"]
Expand All @@ -108,7 +108,7 @@ def test_StandardFileNamer_cmip6(mini_esgf_data):
mini_esgf_data["CMIP6_SICONC"],
use_cftime=True,
combine="by_coords",
)
).load()

checks = [(_ds, "siconc_SImon_CanESM5_historical_r1i1p1f1_gn_18500116-20141216.nc")]

Expand All @@ -124,7 +124,7 @@ def test_StandardFileNamer_cmip6_use_default_attr_names(mini_esgf_data):
mini_esgf_data["CMIP6_SICONC"],
use_cftime=True,
combine="by_coords",
)
).load()

checks = [
(_ds, "siconc_SImon_no-model_historical_r1i1p1f1_no-grid_18500116-20141216.nc")
Expand All @@ -148,7 +148,7 @@ def test_StandardFileNamer_c3s_cordex(mini_esgf_data):
mini_esgf_data["C3S_CORDEX_NAM_PR"],
use_cftime=True,
combine="by_coords",
)
).load()

checks = [
(
Expand All @@ -173,7 +173,7 @@ def test_StandardFileNamer_c3s_cordex_use_default_attr_names(mini_esgf_data):
mini_esgf_data["C3S_CORDEX_NAM_PR"],
use_cftime=True,
combine="by_coords",
)
).load()

checks = [
(
Expand Down
6 changes: 3 additions & 3 deletions tests/test_ops_average.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_average_basic_data_array(open_xclim_dataset):

def test_average_time_xarray(mini_esgf_data):
result = average_over_dims(
mini_esgf_data["CMIP5_TAS"],
xr.open_mfdataset(mini_esgf_data["CMIP5_TAS"]).load(),
dims=["time"],
ignore_undetected_dims=False,
output_type="xarray",
Expand All @@ -48,7 +48,7 @@ def test_average_time_xarray(mini_esgf_data):

def test_average_lat_xarray(mini_esgf_data):
result = average_over_dims(
mini_esgf_data["CMIP5_TAS"],
xr.open_mfdataset(mini_esgf_data["CMIP5_TAS"]).load(),
dims=["latitude"],
ignore_undetected_dims=False,
output_type="xarray",
Expand All @@ -59,7 +59,7 @@ def test_average_lat_xarray(mini_esgf_data):

def test_average_lon_xarray(mini_esgf_data):
result = average_over_dims(
mini_esgf_data["CMIP5_TAS"],
xr.open_mfdataset(mini_esgf_data["CMIP5_TAS"]).load(),
dims=["longitude"],
ignore_undetected_dims=False,
output_type="xarray",
Expand Down

0 comments on commit 0993a40

Please sign in to comment.