Skip to content

Commit

Permalink
Merge branch 'main' into pcat_options_optional
Browse files Browse the repository at this point in the history
  • Loading branch information
aulemahal authored Feb 26, 2025
2 parents 4bf7490 + 7ca21a3 commit 490138c
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"project_slug": "xscen",
"project_short_description": "A climate change scenario-building analysis framework, built with xclim/xarray.",
"pypi_username": "RondeauG",
"version": "0.11.1-dev.2",
"version": "0.11.1-dev.3",
"use_pytest": "y",
"use_black": "y",
"use_conda": "y",
Expand Down
3 changes: 1 addition & 2 deletions docs/notebooks/6_config.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,7 @@
"\n",
"# Create a dummy dataset\n",
"time = pd.date_range(\"1951-01-01\", \"2100-01-01\", freq=\"YS-JAN\")\n",
"da = xr.DataArray([0] * len(time), coords={\"time\": time})\n",
"da.name = \"test\"\n",
"da = xr.DataArray([0] * len(time), coords={\"time\": time}, name=\"test\")\n",
"ds = da.to_dataset()\n",
"\n",
"# Call climatological_op using no argument other than what's in CONFIG\n",
Expand Down
8 changes: 4 additions & 4 deletions environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: xscen-dev
channels:
- conda-forge
dependencies:
- python >=3.10,<3.13
- python >=3.10,<3.14
- pip >=25.0
# Don't forget to sync changes between environment.yml, environment-dev.yml, and pyproject.toml!
# Also consider updating the list in xs.utils.show_versions if you add a new package.
Expand All @@ -11,7 +11,7 @@ dependencies:
- cftime
- cf_xarray >=0.7.6
- clisops >=0.15
- dask >=2024.8.1,<2024.11 # FIXME: https://github.com/Ouranosinc/xclim/issues/1992
- dask >=2024.8.1,<2024.12 # FIXME: Remove upper pin when https://github.com/pangeo-data/rechunker/pull/156 is merged
- flox !=0.9.14 # FIXME: 0.9.14 is a broken version. This pin could be removed eventually.
- fsspec
- geopandas
Expand All @@ -31,10 +31,10 @@ dependencies:
- shapely >=2.0
- sparse
- toolz
- xarray >=2023.11.0, !=2024.6.0, <2024.10.0 # FIXME: 2024.10.0 breaks rechunker with zarr, https://github.com/pangeo-data/rechunker/issues/154
- xarray >=2023.11.0, !=2024.6.0
- xclim >=0.55, <0.56
- xesmf >=0.7, !=0.8.8
- zarr >=2.13, <3.0 # FIXME: xarray is compatible with zarr 3.0 from 2025.01.1, but we pin xarray below that version
- zarr >=2.13, <3
# Opt
- nc-time-axis >=1.3.1
- pyarrow >=10.0.1
Expand Down
8 changes: 4 additions & 4 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: xscen
channels:
- conda-forge
dependencies:
- python >=3.10,<3.13
- python >=3.10,<3.14
- pip >=25.0
# Don't forget to sync changes between environment.yml, environment-dev.yml, and pyproject.toml!
# Also consider updating the list in xs.utils.show_versions if you add a new package.
Expand All @@ -11,7 +11,7 @@ dependencies:
- cftime
- cf_xarray >=0.7.6
- clisops >=0.15
- dask >=2024.8.1,<2024.11 # FIXME: https://github.com/Ouranosinc/xclim/issues/1992
- dask >=2024.8.1,<2024.12 # FIXME: Remove upper pin when https://github.com/pangeo-data/rechunker/pull/156 is merged
- flox !=0.9.14 # FIXME: 0.9.14 is a broken version. This pin could be removed eventually.
- fsspec
- geopandas
Expand All @@ -31,10 +31,10 @@ dependencies:
- shapely >=2.0
- sparse
- toolz
- xarray >=2023.11.0, !=2024.6.0, <2024.10.0 # FIXME: 2024.10.0 breaks rechunker with zarr
- xarray >=2023.11.0, !=2024.6.0
- xclim >=0.55, <0.56
- xesmf >=0.7, !=0.8.8
- zarr >=2.13, <3.0 # FIXME: xarray is compatible with zarr 3.0 from 2025.01.1, but we pin xarray below that version
- zarr >=2.13, <3
# To install from source
- flit >=3.10.1,<4.0
# Opt
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencies = [
"cftime",
"cf_xarray >=0.7.6",
"clisops >=0.15",
"dask >=2024.8.1,<2024.11", # FIXME: https://github.com/Ouranosinc/xclim/issues/1992
"dask >=2024.8.1,<2024.12.0", # FIXME: Remove upper pin when https://github.com/pangeo-data/rechunker/pull/156 is merged
"flox !=0.9.14", # FIXME: 0.9.14 is a broken version. This pin could be removed eventually.
"fsspec",
"geopandas",
Expand All @@ -61,9 +61,9 @@ dependencies = [
"shapely >=2.0",
"sparse",
"toolz",
"xarray >=2023.11.0, !=2024.6.0, <2024.10.0", # FIXME: 2024.10.0 breaks rechunker with zarr
"xarray >=2023.11.0, !=2024.6.0",
"xclim >=0.55, <0.56",
"zarr >=2.13, <3.0" # FIXME: xarray is compatible with zarr 3.0 from 2025.01.1, but we pin xarray below that version"
"zarr >=2.13,<3"
]

[project.optional-dependencies]
Expand Down Expand Up @@ -110,7 +110,7 @@ docs = [
"sphinxcontrib-napoleon"
]
extra = [
"xesmf >=0.7, !=0.8.8"
"xesmf >=0.7, !=0.8.8" # FIXME: 0.8.8 currently creates segfaults on ReadTheDocs.
]
all = ["xscen[dev]", "xscen[docs]", "xscen[extra]"]

Expand All @@ -132,7 +132,7 @@ target-version = [
]

[tool.bumpversion]
current_version = "0.11.1-dev.2"
current_version = "0.11.1-dev.3"
commit = true
commit_args = "--no-verify"
tag = false
Expand Down
2 changes: 1 addition & 1 deletion src/xscen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

__author__ = """Gabriel Rondeau-Genesse"""
__email__ = "rondeau-genesse.gabriel@ouranos.ca"
__version__ = "0.11.1-dev.2"
__version__ = "0.11.1-dev.3"


# FIXME: file and line are unused
Expand Down
5 changes: 5 additions & 0 deletions src/xscen/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,11 @@ def rechunk(
ds = xr.open_dataset(path_in)
else:
ds = path_in
# Remove all input chunks information, avoids an error with rechunker and xarray >= 2024.10
# TODO: Remove this and pin rechunker when https://github.com/pangeo-data/rechunker/pull/156 is merged and released
for var in ds.variables.values():
var.encoding.pop("chunks", None)

variables = list(ds.data_vars)
if chunks_over_var:
chunks = chunks_over_var
Expand Down

0 comments on commit 490138c

Please sign in to comment.