Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Fix DeprecationWarning on import. ([PR #128](https://github.com/ClimateImpactLab/dscim/pull/128), [@brews](https://github.com/brews))
- Fix write-to-copy warning in `process_rff_sample()`. ([PR #116](https://github.com/ClimateImpactLab/dscim/pull/116), [@brews](https://github.com/brews))
- Fix exception from indexing with dask-backed boolean array and input climate Dataset attrs collision with xarray >= v2023.3.0. ([PR #129](https://github.com/ClimateImpactLab/dscim/pull/129), [@brews](https://github.com/brews))
- Fix bad release header links in CHANGELOG.md. ([PR #105](https://github.com/ClimateImpactLab/dscim/pull/105), [@brews](https://github.com/brews))
- Fixed broken code quality checks in CI. Now using `ruff` instead of `flake8`. ([PR #107](https://github.com/ClimateImpactLab/dscim/pull/107), [@brews](https://github.com/brews))
- Minor code style cleanup. ([PR #133](https://github.com/ClimateImpactLab/dscim/pull/133), [@brews](https://github.com/brews))
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is used to build the CI test environment and so Github can track dependencies.
xarray==2022.11.0
pandas==2.1.0
xarray==2023.8.0
pandas==2.0.3
numpy==1.25.2
matplotlib==3.7.2
dask[array, distributed]==2023.8.1
Expand Down
4 changes: 3 additions & 1 deletion src/dscim/menu/simple_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ def anomalies(self):
masks the data according to the mask passed to self.ecs_mask_path.
"""
if self.gmsl_fair_path is not None:
anomaly = xr.combine_by_coords([self.gmst_anomalies, self.gmsl_anomalies])
anomaly = xr.combine_by_coords(
[self.gmst_anomalies, self.gmsl_anomalies], combine_attrs="drop"
)
else:
anomaly = self.gmst_anomalies

Expand Down
6 changes: 4 additions & 2 deletions src/dscim/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,12 @@ def c_equivalence(array, dims, eta, weights=None, func_args=None, func=None):
"""

if isinstance(array, xr.DataArray):
negative_values = array.where(lambda x: x < 0, drop=True).size
negative_values = array.where(lambda x: (x < 0).compute(), drop=True).size
elif isinstance(array, xr.Dataset):
negative_values = (
array[list(array.variables)[0]].where(lambda x: x < 0, drop=True).size
array[list(array.variables)[0]]
.where(lambda x: (x < 0).compute(), drop=True)
.size
)
else:
raise TypeError("array should be either an xarray.DataArray or xarray.Dataset")
Expand Down