Skip to content

Commit cefd4fc

Browse files
authored
Merge pull request #179 from emileten/relocate-data-loading-clean-cmip6
relocate data loading in standardize-gcm
2 parents 0063f9c + 55fbe81 commit cefd4fc

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8-
8+
### Fixed
9+
- Move in-memory data loading where it is needed for 360-days calendar conversion in clean-cmip6 (PR #179, @emileten)
910

1011
## [0.16.2] - 2022-02-15
1112
### Fixed

dodola/core.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,11 @@ def standardize_gcm(ds, leapday_removal=True):
381381
if ds_cleaned.time.dtype == "int64":
382382
ds_cleaned["time"] = xr.decode_cf(ds_cleaned).time
383383
if cal == "360_day":
384+
385+
# Cannot have chunks in time dimension for 360 day calendar conversion so loading
386+
# data into memory.
387+
ds_cleaned.load()
388+
384389
if leapday_removal: # 360 day -> noleap
385390
ds_converted = xclim_convert_360day_calendar_interpolate(
386391
ds=ds_cleaned,

dodola/services.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,10 +593,6 @@ def clean_cmip6(x, out, leapday_removal):
593593
"""
594594
ds = storage.read(x)
595595

596-
# Cannot have chunks in time dimension for 360 day calendar conversion so loading
597-
# data into memory.
598-
ds.load()
599-
600596
cleaned_ds = standardize_gcm(ds, leapday_removal)
601597
storage.write(out, cleaned_ds)
602598

0 commit comments

Comments
 (0)