Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve partition #504

Merged
merged 43 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
cfd4218
add calendar
juliettelavoie Jan 19, 2024
2dede98
improve cal
juliettelavoie Jan 25, 2024
48ed051
remove chunks
juliettelavoie Jan 26, 2024
16ed840
Merge remote-tracking branch 'origin/main' into improve-partition
juliettelavoie Jan 29, 2024
34739f6
drop_vars
juliettelavoie Jan 30, 2024
c2c648e
add subcat possibility to avoid merge
juliettelavoie Feb 21, 2024
4519048
real
juliettelavoie Feb 21, 2024
123d42d
Merge remote-tracking branch 'origin/main' into improve-partition
juliettelavoie Feb 27, 2024
13fa197
add datacatalog option
juliettelavoie Feb 27, 2024
d4ffe92
add real to part_dim
juliettelavoie Mar 6, 2024
d0a097d
remove moving_rearly_window
juliettelavoie May 9, 2024
3378757
fix A-DEC
juliettelavoie May 13, 2024
5ed7105
Merge branch 'main' into improve-partition
juliettelavoie May 14, 2024
95f50f9
subdivise
juliettelavoie May 23, 2024
650803e
common_attrs
juliettelavoie May 23, 2024
b8d66d0
add ref and method to cat
juliettelavoie May 23, 2024
2a41984
index
juliettelavoie May 23, 2024
f667026
real in from cat
juliettelavoie May 24, 2024
8414c10
to level
juliettelavoie Jun 7, 2024
e27ebb7
to level type
juliettelavoie Jun 7, 2024
d9d0535
adjustment instead
juliettelavoie Jun 10, 2024
79dd1b0
subcat
juliettelavoie Jun 10, 2024
721dd0f
merge
juliettelavoie Jan 6, 2025
0f53e79
cleanup
juliettelavoie Jan 6, 2025
7894515
add tests
juliettelavoie Jan 7, 2025
cc699fc
Merge branch 'main' into improve-partition
juliettelavoie Jan 7, 2025
61eb239
pr num
juliettelavoie Jan 7, 2025
e283333
Merge remote-tracking branch 'origin/improve-partition' into improve-…
juliettelavoie Jan 7, 2025
9ecc8c9
pin xarray
juliettelavoie Jan 7, 2025
1f5baa5
pin xarray
juliettelavoie Jan 7, 2025
10cd31b
pin xarray
juliettelavoie Jan 7, 2025
7fe8abd
fix doc
juliettelavoie Jan 7, 2025
c4aaf08
changelog
juliettelavoie Jan 7, 2025
98aa4ba
update xclim v
juliettelavoie Jan 7, 2025
0edc0aa
update xclim v
juliettelavoie Jan 7, 2025
fa884c0
fix docs
juliettelavoie Jan 8, 2025
32350ff
fix test
juliettelavoie Jan 8, 2025
4ebc4c3
remove test
juliettelavoie Jan 8, 2025
afd6437
try again
juliettelavoie Jan 8, 2025
e3c8bf5
Apply suggestions from code review
juliettelavoie Jan 15, 2025
ea1a99a
remove print
juliettelavoie Jan 15, 2025
0ca11fd
pin zarr
juliettelavoie Jan 15, 2025
d9ab991
fix name
juliettelavoie Jan 15, 2025
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
4 changes: 2 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Changelog

v0.11.0 (unreleased)
--------------------
Contributors to this version: Gabriel Rondeau-Genesse (:user:`RondeauG`).
Contributors to this version: Gabriel Rondeau-Genesse (:user:`RondeauG`), Juliette Lavoie (:user:`juliettelavoie`).

New features and enhancements
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* N/A
* Improve ``xs.ensembles.build_partition_data``. (:pull:`504`).

Breaking changes
^^^^^^^^^^^^^^^^
Expand Down
16 changes: 12 additions & 4 deletions docs/notebooks/4_ensembles.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -169,19 +169,28 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"is_executing": true
},
"outputs": [],
"source": [
"# Get catalog\n",
"from pathlib import Path\n",
"\n",
"import xclim as xc\n",
"\n",
"output_folder = Path().absolute() / \"_data\"\n",
"cat = xs.DataCatalog(str(output_folder / \"tutorial-catalog.json\"))\n",
"\n",
"# create a dictionnary of datasets wanted for the partition\n",
"input_dict = cat.search(variable=\"tas\", member=\"r1i1p1f1\").to_dataset_dict(\n",
" xarray_open_kwargs={\"engine\": \"h5netcdf\"}\n",
")"
")\n",
"datasets = {}\n",
"for k, v in input_dict.items():\n",
" ds = xc.atmos.tg_mean(v.tas).to_dataset()\n",
" ds.attrs = v.attrs\n",
" datasets[k] = ds"
]
},
{
Expand All @@ -204,9 +213,8 @@
"import xclim as xc\n",
"\n",
"ds = xs.ensembles.build_partition_data(\n",
" input_dict,\n",
" datasets,\n",
" subset_kw=dict(name=\"mtl\", method=\"gridpoint\", lat=[45.5], lon=[-73.6]),\n",
" indicators_kw={\"indicators\": [xc.atmos.tg_mean]},\n",
")\n",
"ds"
]
Expand Down
7 changes: 4 additions & 3 deletions environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ dependencies:
- shapely >=2.0
- sparse
- toolz
- xarray >=2023.11.0, !=2024.6.0
- xclim >=0.53.2, <0.54
- 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
- xclim >=0.54, <0.55
juliettelavoie marked this conversation as resolved.
Show resolved Hide resolved
- xesmf >=0.7, <0.8.8 # FIXME: 0.8.8 currently creates segfaults on ReadTheDocs.
- zarr >=2.13
- zarr >=2.13, <3.0 #FIXME: xarray is compatible with zarr 3.0 from 2025.01.1, but we pin xarray below that version
# Opt
- nc-time-axis >=1.3.1
- pyarrow >=10.0.1
Expand All @@ -56,6 +56,7 @@ dependencies:
- pandoc
- pooch
- pre-commit >=3.5.0
- pygments <2.19 #FIXME: temporary fix, https://github.com/felix-hilden/sphinx-codeautolink/issues/153
- pytest >=8.3.2
- pytest-cov >=5.0.0
- pytest-xdist >=3.2.0
Expand Down
6 changes: 3 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ dependencies:
- shapely >=2.0
- sparse
- toolz
- xarray >=2023.11.0, !=2024.6.0
- xclim >=0.53.2, <0.54
- xarray >=2023.11.0, !=2024.6.0, <2024.10.0 #FIXME: 2024.10.0 breaks rechunker with zarr
- xclim >=0.54, <0.55
- xesmf >=0.7, <0.8.8 # FIXME: 0.8.8 currently creates segfaults on ReadTheDocs.
- zarr >=2.13
- zarr >=2.13, <3.0 #FIXME: xarray is compatible with zarr 3.0 from 2025.01.1, but we pin xarray below that version
# To install from source
- setuptools >=65.0.0
- setuptools-scm >=8.0.0
Expand Down
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ dependencies = [
"shapely >=2.0",
"sparse",
"toolz",
"xarray >=2023.11.0, !=2024.6.0",
"xclim >=0.53.2, <0.54",
"zarr >=2.13"
"xarray >=2023.11.0, !=2024.6.0, <2024.10.0", # FIXME: 2024.10.0 breaks rechunker with zarr
"xclim >=0.54, <0.55",
"zarr >=2.13, <3.0" # FIXME: xarray is compatible with zarr 3.0 from 2025.01.1, but we pin xarray below that version"
]

[project.optional-dependencies]
Expand Down Expand Up @@ -109,7 +109,8 @@ docs = [
"sphinx-intl",
"sphinx-mdinclude",
"sphinx-rtd-theme >=1.0",
"sphinxcontrib-napoleon"
"sphinxcontrib-napoleon",
"pygments <2.19" # FIXME: temporary fix, https://github.com/felix-hilden/sphinx-codeautolink/issues/153
]
extra = [
"xesmf>=0.7, <0.8.8" # FIXME: 0.8.8 currently creates segfaults on ReadTheDocs.
Expand Down
Binary file modified src/xscen/data/fr/LC_MESSAGES/xscen.mo
Binary file not shown.
Loading
Loading