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

Block-mapped resample with the help of flox #1848

Merged
merged 42 commits into from
Oct 10, 2024
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
30f28fe
Resample map helper
aulemahal Jul 19, 2024
88fa90b
merge generic-season
aulemahal Jul 19, 2024
065b4f3
New split_aux_coord func to remove aux coord and avoid dask comp on a…
aulemahal Jul 23, 2024
0c8c797
Ignore missing flox dep
aulemahal Jul 23, 2024
9c81ed8
Fix for bool mask
aulemahal Jul 23, 2024
764d67b
Fix aux coord mngmt in lazy indexing - fix doc split aux coord
aulemahal Jul 24, 2024
3d4c457
lower pin of flit
Jul 24, 2024
3adbf76
fix a fix that didnt fix what needed to be fixed
aulemahal Jul 26, 2024
befc53f
Merge branch 'resample-map' of github.com:Ouranosinc/xclim into resam…
aulemahal Jul 26, 2024
0bcbe5a
merge master and heat_spell
Aug 15, 2024
58fe1a0
Merge branch 'heat_spell' into resample-map
Aug 15, 2024
c39b47e
Merge branch 'heat_spell' into resample-map
Aug 15, 2024
9778739
Resample before spells
Aug 16, 2024
a7e5bde
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 16, 2024
b9d79b0
Revert "[pre-commit.ci] auto fixes from pre-commit.com hooks"
aulemahal Aug 16, 2024
b0fd634
Revert "Resample before spells"
aulemahal Aug 16, 2024
5a407aa
Merge branch 'heat_spell' into resample-map
Aug 18, 2024
167a387
merge main
Aug 28, 2024
38070c8
Merge branch 'main' into resample-map
Zeitsperre Aug 28, 2024
cef0e25
multi reducing
aulemahal Sep 5, 2024
df8c792
merge main
aulemahal Sep 6, 2024
90c14ef
fix deps - add minimal tests
aulemahal Sep 6, 2024
03d236e
add changelog
aulemahal Sep 6, 2024
1f3e82e
Dont test resample-map without flox
aulemahal Sep 6, 2024
b1dd2ac
Apply suggestions from code review
aulemahal Sep 6, 2024
8b717b3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 6, 2024
881812b
Merge branch 'main' into resample-map
aulemahal Sep 27, 2024
561c54a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 27, 2024
54e5234
Skip auxiliary coords test
aulemahal Oct 1, 2024
ee2e352
add tests
aulemahal Oct 1, 2024
15fb7ed
Merge branch 'main' into resample-map
aulemahal Oct 3, 2024
6fcd4a9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 3, 2024
9669035
Merge branch 'main' into resample-map
aulemahal Oct 3, 2024
50ffcff
Import callable
aulemahal Oct 4, 2024
d5d638a
fix test
aulemahal Oct 4, 2024
470f825
Merge branch 'main' into resample-map
aulemahal Oct 7, 2024
bb47d2b
Resample map for chill portions
aulemahal Oct 8, 2024
7817813
Merge branch 'main' into resample-map
aulemahal Oct 8, 2024
8096991
Merge branch 'main' into resample-map
Zeitsperre Oct 8, 2024
57da575
Fix docstring
aulemahal Oct 9, 2024
298386b
Merge branch 'main' into resample-map
aulemahal Oct 9, 2024
1a584d4
Merge branch 'main' into resample-map
aulemahal Oct 9, 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
13 changes: 11 additions & 2 deletions tests/test_indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
from xclim.core.options import set_options
from xclim.core.units import convert_units_to, units

try:
import flox
except ImportError:
flox = None
aulemahal marked this conversation as resolved.
Show resolved Hide resolved

K2C = 273.15


Expand Down Expand Up @@ -1430,7 +1435,9 @@ def test_resampling_order(self, tasmax_series, resample_before_rl, expected):
a[5:35] = 31
tx = tasmax_series(a + K2C).chunk()

with set_options(resample_map_blocks=resample_before_rl):
with set_options(
resample_map_blocks=(resample_before_rl and (flox is not None))
):
hsf = xci.hot_spell_frequency(
tx, resample_before_rl=resample_before_rl, freq="MS"
).load()
Expand Down Expand Up @@ -1710,7 +1717,9 @@ def test_resampling_order(self, pr_series, resample_before_rl, expected):
a = np.zeros(365) + 10
a[5:35] = 0
pr = pr_series(a).chunk()
with set_options(resample_map_blocks=resample_before_rl):
with set_options(
resample_map_blocks=(resample_before_rl and (flox is not None))
):
out = xci.maximum_consecutive_dry_days(
pr, freq="ME", resample_before_rl=resample_before_rl
).load()
Expand Down
Loading