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

Update xclim #414

Merged
merged 44 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
ede3f1a
remove requests code
Zeitsperre Sep 30, 2024
3c211d7
WIP - first stab at modernizing finch
Zeitsperre Sep 30, 2024
1d5d12a
Merge branch 'master' into update-xclim
Zeitsperre Oct 29, 2024
36959a1
Avoid bugs of xclim 0.52
aulemahal Oct 29, 2024
42a9447
Merge branch 'update-xclim' of github.com:bird-house/finch into updat…
aulemahal Oct 29, 2024
b2e625a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 29, 2024
07a149d
Fix more Parameter is not dict - fix Humidex units
aulemahal Oct 29, 2024
0ec4329
Merge branch 'update-xclim' of github.com:bird-house/finch into updat…
aulemahal Oct 29, 2024
f3a6e8e
try to use xscen for spatial_avg
tlogan2000 Oct 29, 2024
6a79eaf
xscen for spatial_avg WIP
tlogan2000 Oct 30, 2024
ad12da7
xscen for spatial_avg WIP
tlogan2000 Oct 30, 2024
61e3222
Merge remote-tracking branch 'origin/update-xclim' into update-xclim
tlogan2000 Oct 30, 2024
57ea742
add xscen to requirements
tlogan2000 Oct 30, 2024
834dc14
tests for spatial averaging with xscen
tlogan2000 Oct 30, 2024
73f506f
small changes
tlogan2000 Oct 31, 2024
11245ad
test spatial avg no percentiles
tlogan2000 Oct 31, 2024
dce2d09
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 31, 2024
d211b62
black failure
tlogan2000 Oct 31, 2024
e83ee10
Merge remote-tracking branch 'origin/use_xscen_new' into use_xscen_new
tlogan2000 Oct 31, 2024
dcc340e
black failure
tlogan2000 Oct 31, 2024
00339cc
unpin xscen for now
tlogan2000 Oct 31, 2024
211fd6a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 31, 2024
90ec641
fix bbox, history, csv order, skip geomet processes
tlogan2000 Dec 5, 2024
5051539
fix bbox, history, csv order, skip geomet processes
tlogan2000 Dec 5, 2024
192291c
Merge branch 'use_xscen_new' of https://github.com/bird-house/finch i…
tlogan2000 Dec 5, 2024
3a6fec7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 5, 2024
a3da943
re mplement lost bbox fix
tlogan2000 Dec 6, 2024
e2c5314
Merge remote-tracking branch 'origin/use_xscen_new' into use_xscen_new
tlogan2000 Dec 6, 2024
1debaa2
Fix is_opendap - pin xesmf - use pytest for tmp paths
aulemahal Dec 9, 2024
ccd61aa
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 9, 2024
659c149
fix f-string pep8
aulemahal Dec 9, 2024
b716fb1
Merge branch 'use_xscen_new' of github.com:bird-house/finch into use_…
aulemahal Dec 9, 2024
338b37b
drop 3.9, add 3.12
aulemahal Dec 9, 2024
30ac9bb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 9, 2024
93358c6
Merge branch 'master' into update-xclim
Zeitsperre Dec 12, 2024
a0fd763
update changelog
tlogan2000 Dec 12, 2024
330bab0
Use xscen new (#427)
Zeitsperre Dec 12, 2024
a93c18b
Merge branch 'master' into update-xclim
Zeitsperre Dec 16, 2024
a55a3aa
Merge branch 'master' into update-xclim
Zeitsperre Dec 17, 2024
1705fb1
better formatting of YAML, synchronize dependencies
Zeitsperre Dec 17, 2024
143898b
update pandas version
Zeitsperre Dec 17, 2024
411a67b
update xarray version
Zeitsperre Dec 17, 2024
1d99a07
add setuptools
Zeitsperre Dec 17, 2024
8745a29
allow connection to PyPI, fix setuptools version, specify Python3.10+
Zeitsperre Dec 17, 2024
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
6 changes: 3 additions & 3 deletions .codacy.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
engines:
pylint:
enabled: true
python_version: 3
pylint:
enabled: true
python_version: 3
exclude_paths:
- 'tests/**'
- 'docs/source/conf.py'
1 change: 1 addition & 0 deletions .github/workflows/docker-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
allowed-endpoints: >
auth.docker.io:443
conda.anaconda.org:443
files.pythonhosted.org:443
github.com:443
production.cloudflare.docker.com:443
pypi.org:443
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ jobs:
run:
shell: bash -l {0}
strategy:
matrix:
python-version: [ "3.9", "3.10", "3.11" ] # "3.12"
matrix:
python-version: [ "3.10", "3.11", "3.12" ]
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:
rev: v3.17.0
hooks:
- id: pyupgrade
args: [ '--py39-plus' ]
args: [ '--py310-plus' ]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
Expand All @@ -30,7 +30,7 @@ repos:
rev: 24.10.0
hooks:
- id: black
args: [ '--target-version=py39' ]
args: [ '--target-version=py310' ]
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
Expand All @@ -46,10 +46,10 @@ repos:
rev: 1.8.7
hooks:
- id: nbqa-black
args: [ '--target-version=py39' ]
args: [ '--target-version=py310' ]
additional_dependencies: [ 'black==24.8.0' ]
- id: nbqa-pyupgrade
args: [ '--py39-plus' ]
args: [ '--py310-plus' ]
additional_dependencies: [ 'pyupgrade==3.17.0' ]
- id: nbqa-isort
args: [ '--settings-file=setup.cfg' ]
Expand Down
6 changes: 3 additions & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ sphinx:
fail_on_warning: false

# Optionally build your docs in additional formats such as PDF and ePub
formats: []
formats: [ ]

build:
os: ubuntu-22.04
os: ubuntu-lts-latest
tools:
python: "mambaforge-22.9"
python: "mambaforge-latest"

conda:
environment: environment-docs.yml
Expand Down
33 changes: 32 additions & 1 deletion .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,39 @@
---

rules:

brackets:
forbid: false
min-spaces-inside: 1
max-spaces-inside: 1

commas:
min-spaces-after: 1

document-start: disable

float-values:
require-numeral-before-decimal: true

hyphens:
max-spaces-after: 1

indentation:
indent-sequences: whatever
spaces: consistent

key-duplicates:
forbid-duplicated-merge-keys: true

line-length:
max: 120
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: true
max: 140
level: warning

new-lines:
type: unix

trailing-spaces: {}

truthy: disable
3 changes: 2 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ v0.13.0 (unreleased)
* Permissions have been set for all workflows.
* Pinned `cf-xarray`` below v0.9.3.
* Reformatted and renamed `CHANGES.rst` to `CHANGELOG.rst`.
* Dropped support for Python 3.8. The supported versions are now Python 3.9, 3.10, and 3.11.
* Dropped support for Python 3.8 and 3.9. The supported versions are now Python 3.10, 3.11 and 3.12.
* `black` has been updated to v2024.8.0, and coding conventions have been updated to Python3.9+.
* Several dependencies now are pinned to baseline versions, including `anyascii`, `dask`, `ipython`, `matplotlib`, `nbsphinx` `numpy`, and `sphinxcontrib-bibtex`.
* Added `xscen` dependency. Now used in spatial averaging of ensemble processes.

v0.12.1 (2024-06-25)
--------------------
Expand Down
11 changes: 6 additions & 5 deletions environment-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ name: finch
channels:
- conda-forge
dependencies:
- python >=3.8,<3.12
- anyascii >=0.3.2
- python >=3.10,<3.13
- anyascii >=0.3.0
- birdy >=0.8.1
- ipython >=8.0.0
- matplotlib-base >=3.5.0
- nbsphinx >=0.9.5
- pandas >=1.5.3,<2.2.0
- pandas >=2.2.0
- pywps >=4.5.1
- setuptools >=71.0.0
- sphinx >=7.0.0
- sphinxcontrib-bibtex >=2.6.0
- xarray >=2023.01.0,<2023.11.0
- xclim =0.43 # remember to match xclim version in requirements_docs.txt as well
- xarray >=2023.11.0
- xclim ==0.52.2 # remember to match xclim version in requirements_docs.txt as well
20 changes: 10 additions & 10 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@ name: finch
channels:
- conda-forge
dependencies:
- python >=3.9,<3.12
- python >=3.10,<3.13
- pip >=24.2.0
- anyascii >=0.3.0
- cftime
- cf_xarray >=0.6.1,<0.9.3
- cftime >=1.4.1
- cf_xarray >=0.9.3
- click >=8.0.0
- clisops >=0.11.0
- dask >=2023.5.1
- distributed
- geopandas !=0.13.1
- h5netcdf
- netcdf4 <=1.6.5
- numpy >=1.23.0
- pandas >=1.5.3,<2.2.0
- pandas >=2.2.0
- parse
- psutil
- python-slugify
- pywps >=4.5.1
- pyyaml
- requests>=2.32.2
- pyyaml >=6.0.1
- scipy >=1.9.0
- sentry-sdk
- setuptools >=71.0.0
- siphon
- xarray >=2023.01.0,<2023.11.0
- xclim =0.43 # remember to match xclim version in requirements_docs.txt as well
- xesmf >=0.8.2
- xarray >=2023.11.0
- xclim =0.52.2 # remember to match xclim version in requirements_docs.txt as well
- xesmf >=0.8.2,!=0.8.8
- xscen
124 changes: 62 additions & 62 deletions finch/datasets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ candcs-u5:
suffix: "*.nc"
pattern: "{variable}_{frequency}_BCCAQv2+ANUSPLIN300_{model}_{scenario}_{realization}_{date_start}-{date_end}.nc"
allowed_values:
scenario: [rcp26, rcp45, rcp85]
variable: [tasmin, tasmax, pr]
scenario: [ rcp26, rcp45, rcp85 ]
variable: [ tasmin, tasmax, pr ]
model:
&u5models
- BNU-ESM
Expand Down Expand Up @@ -39,18 +39,18 @@ candcs-u5:
24models: *u5models
pcic12:
# taken from: https://www.pacificclimate.org/data/statistically-downscaled-climate-scenarios
- [ ACCESS1-0 , r1i1p1 ]
- [ CCSM4 , r2i1p1 ]
- [ CNRM-CM5 , r1i1p1 ]
- [ CSIRO-Mk3-6-0 , r1i1p1 ]
- [ CanESM2 , r1i1p1 ]
- [ GFDL-ESM2G , r1i1p1 ]
- [ HadGEM2-CC , r1i1p1 ]
- [ HadGEM2-ES , r1i1p1 ]
- [ MIROC5 , r3i1p1 ]
- [ MPI-ESM-LR , r3i1p1 ]
- [ MRI-CGCM3 , r1i1p1 ]
- [ inmcm4 , r1i1p1 ]
- [ ACCESS1-0, r1i1p1 ]
- [ CCSM4, r2i1p1 ]
- [ CNRM-CM5, r1i1p1 ]
- [ CSIRO-Mk3-6-0, r1i1p1 ]
- [ CanESM2, r1i1p1 ]
- [ GFDL-ESM2G, r1i1p1 ]
- [ HadGEM2-CC, r1i1p1 ]
- [ HadGEM2-ES, r1i1p1 ]
- [ MIROC5, r3i1p1 ]
- [ MPI-ESM-LR, r3i1p1 ]
- [ MRI-CGCM3, r1i1p1 ]
- [ inmcm4, r1i1p1 ]

# This is a copy of the above for backward compatibility reasons.
bccaqv2: *candcsu5
Expand All @@ -62,7 +62,7 @@ candcs-u6:
pattern: "{variable}_{frequency}_BCCAQv2+ANUSPLIN300_{model}_{scenario}_{realization}_{}_{date_start}-{date_end}.nc"
allowed_values:
scenario: [ ssp126, ssp245, ssp585 ]
variable: [ tasmin, tasmax, pr]
variable: [ tasmin, tasmax, pr ]
model:
- ACCESS-CM2
- ACCESS-ESM1-5
Expand Down Expand Up @@ -92,61 +92,61 @@ candcs-u6:
- UKESM1-0-LL
model_lists:
26models:
- ACCESS-CM2
- ACCESS-ESM1-5
- BCC-CSM2-MR
- CMCC-ESM2
- CNRM-CM6-1
- CNRM-ESM2-1
- CanESM5
- [EC-Earth3, r4i1p1f1]
- EC-Earth3-Veg
- FGOALS-g3
- GFDL-ESM4
- HadGEM3-GC31-LL
- INM-CM4-8
- INM-CM5-0
- IPSL-CM6A-LR
- [KACE-1-0-G, r2i1p1f1]
- KIOST-ESM
- MIROC-ES2L
- MIROC6
- MPI-ESM1-2-HR
- MPI-ESM1-2-LR
- MRI-ESM2-0
- NorESM2-LM
- NorESM2-MM
- TaiESM1
- UKESM1-0-LL
- ACCESS-CM2
- ACCESS-ESM1-5
- BCC-CSM2-MR
- CMCC-ESM2
- CNRM-CM6-1
- CNRM-ESM2-1
- CanESM5
- [ EC-Earth3, r4i1p1f1 ]
- EC-Earth3-Veg
- FGOALS-g3
- GFDL-ESM4
- HadGEM3-GC31-LL
- INM-CM4-8
- INM-CM5-0
- IPSL-CM6A-LR
- [ KACE-1-0-G, r2i1p1f1 ]
- KIOST-ESM
- MIROC-ES2L
- MIROC6
- MPI-ESM1-2-HR
- MPI-ESM1-2-LR
- MRI-ESM2-0
- NorESM2-LM
- NorESM2-MM
- TaiESM1
- UKESM1-0-LL

humidex-daily:
local: false
depth: 1
path: https://pavics.ouranos.ca/twitcher/ows/proxy/thredds/catalog/birdhouse/eccc/CCCS_humidex/Humidex/daily/catalog.html
pattern: "{variable}_MBCn_ERA5-Land_{model}_{scenario}_{realization}_{date_start}-{date_end}.nc"
allowed_values:
scenario: [ssp126, ssp245, ssp585]
variable: [HXmax]
scenario: [ ssp126, ssp245, ssp585 ]
variable: [ HXmax ]
model:
&hxmax_day_models
- MPI-ESM1-2-HR
- EC-Earth3
- ACCESS-CM2
- MIROC-ES2L
- EC-Earth3-Veg
- IPSL-CM6A-LR
- INM-CM5-0
- FGOALS-g3
- CanESM5
- MIROC6
- GISS-E2-1-G
- EC-Earth3-Veg-LR
- CNRM-ESM2-1
- MPI-ESM1-2-LR
- INM-CM4-8
- MRI-ESM2-0
- CMCC-ESM2
- ACCESS-ESM1-5
- CNRM-CM6-1
- MPI-ESM1-2-HR
- EC-Earth3
- ACCESS-CM2
- MIROC-ES2L
- EC-Earth3-Veg
- IPSL-CM6A-LR
- INM-CM5-0
- FGOALS-g3
- CanESM5
- MIROC6
- GISS-E2-1-G
- EC-Earth3-Veg-LR
- CNRM-ESM2-1
- MPI-ESM1-2-LR
- INM-CM4-8
- MRI-ESM2-0
- CMCC-ESM2
- ACCESS-ESM1-5
- CNRM-CM6-1
model_lists:
humidex_models: *hxmax_day_models
16 changes: 12 additions & 4 deletions finch/processes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# noqa: D104
import logging
from pathlib import Path

from pywps.configuration import get_config_value
from xclim.core.indicator import registry as xclim_registry
Expand Down Expand Up @@ -52,11 +51,20 @@ def filter_func(elem):

not_implemented = [
"DC",
"E_SAT",
"FWI",
"HURS",
"HURS_FROMDEWPOINT",
"HUSS",
"HUSS_FROMDEWPOINT",
"RH",
"RH_FROMDEWPOINT",
"E_SAT",
"HUSS",
"SPI",
"SPEI",
"WIND_POWER_POTENTIAL",
"WIND_PROFILE",
"WIND_SPEED_FROM_VECTOR",
"WIND_VECTOR_FROM_SPEED",
]


Expand Down Expand Up @@ -135,7 +143,7 @@ def get_processes():
SubsetPolygonProcess(),
AveragePolygonProcess(),
HourlyToDailyProcess(),
GeoseriesToNetcdfProcess(),
# GeoseriesToNetcdfProcess(),
]

return processes
Loading
Loading