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

Drop Python3.8, support Pandas v2.2, reduce Warnings #1565

Merged
merged 50 commits into from
Jan 29, 2024
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
de79e09
pre-commit update
Zeitsperre Dec 18, 2023
28d7c0e
drop all Python3.8 in top-level
Zeitsperre Dec 18, 2023
839585f
pyupgrade fixes
Zeitsperre Dec 18, 2023
08ae98d
include tests in ruff checks
Zeitsperre Dec 18, 2023
fc84c89
limit to Python3.11
Zeitsperre Dec 18, 2023
8853ec0
drop Python3.8
Zeitsperre Dec 18, 2023
1ee9d24
fix import, fix docs
Zeitsperre Dec 18, 2023
edde1e2
small signature adjustments, docstring fixes
Zeitsperre Dec 18, 2023
f911164
safer Python calls
Zeitsperre Dec 18, 2023
6fe7566
update read-the-docs package name
Zeitsperre Jan 3, 2024
dc21fb0
Merge branch 'master' into drop-python38
Zeitsperre Jan 3, 2024
288346f
Merge branch 'master' into drop-python38
Zeitsperre Jan 10, 2024
084dc96
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 10, 2024
a4b4c35
Merge branch 'master' into drop-python38
Zeitsperre Jan 22, 2024
8c7dcfb
fix toml error
Zeitsperre Jan 22, 2024
08b2289
small adjustments to frequencies
Zeitsperre Jan 22, 2024
b01c6ce
Add fixme notice about silently failing tests
Zeitsperre Jan 22, 2024
91a7030
remove deprecated winter_storm indice and indicator
Zeitsperre Jan 22, 2024
ffc6ad8
raise version pins on numpy, scipy, and pandas; remove legacy version…
Zeitsperre Jan 22, 2024
ee43930
update CHANGES.rst
Zeitsperre Jan 22, 2024
6e7c832
Merge branch 'master' into drop-python38
Zeitsperre Jan 22, 2024
c37c487
Apply suggestions from code review
Zeitsperre Jan 23, 2024
a27aa62
Merge branch 'master' into drop-python38
Zeitsperre Jan 23, 2024
109bd5a
merge topd22 commit 1
aulemahal Jan 22, 2024
b6718fd
Merge branch 'master' into drop-python38
aulemahal Jan 23, 2024
da806bb
reduce test warnings, fix some docstrings, add pyarrow to dependencie…
Zeitsperre Jan 23, 2024
25bcf0b
docstring fixes and warnings reduction
Zeitsperre Jan 23, 2024
276dd4d
silence numba.vectorize decorator warnings
Zeitsperre Jan 23, 2024
d4dcff0
investigate weekofyear FutureWarning
Zeitsperre Jan 23, 2024
c7eab8b
Remove deprecated code - remove warnings - avoid using YE with cftime
aulemahal Jan 23, 2024
d1ce1dd
Merge branch 'drop-python38' of github.com:Ouranosinc/xclim into drop…
aulemahal Jan 23, 2024
389e26d
remove debugging leftover
aulemahal Jan 23, 2024
e8e85e2
silence pint-related warnings, add note on how to eventually resolve
Zeitsperre Jan 23, 2024
dd68994
remove noqa
Zeitsperre Jan 23, 2024
bad864f
ignore division by zero errors in to_additive_space
Zeitsperre Jan 23, 2024
2c8ecec
handle pint string formatting, point to ongoing issue upstream
Zeitsperre Jan 23, 2024
5946c61
filter DeprecationWarnings stemming from pint value string formatting
Zeitsperre Jan 23, 2024
57ce43f
fix rl for xr 2024.01
aulemahal Jan 23, 2024
bad8f84
Remove mention of older scipy in tests
aulemahal Jan 23, 2024
ab481ca
Remove debugging print
aulemahal Jan 23, 2024
a7a3d1e
Merge branch 'master' into drop-python38
Zeitsperre Jan 24, 2024
21c966d
Merge branch 'master' into drop-python38
Zeitsperre Jan 25, 2024
d0d9422
Apply suggestions from code review
Zeitsperre Jan 25, 2024
cb97a9c
Merge branch 'master' into drop-python38
Zeitsperre Jan 25, 2024
5f59e31
remove Python3.8-backported library
Zeitsperre Jan 25, 2024
e54626c
Merge branch 'master' into drop-python38
Zeitsperre Jan 26, 2024
69f1e6b
update CHANGES.rst
Zeitsperre Jan 26, 2024
d679f7b
update pyupgrade style
Zeitsperre Jan 26, 2024
ca84199
Update CHANGES.rst
Zeitsperre Jan 29, 2024
8bd6efc
Merge branch 'master' into drop-python38
Zeitsperre Jan 29, 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
11 changes: 8 additions & 3 deletions xclim/indices/run_length.py
Original file line number Diff line number Diff line change
Expand Up @@ -1005,12 +1005,14 @@ def first_run_after_date(
if mid_idx.size == 0: # The date is not within the group. Happens at boundaries.
return xr.full_like(da.isel({dim: 0}), np.nan, float).drop_vars(dim)

return first_run(
out = first_run(
da.where(da[dim] >= da[dim][mid_idx][0]),
window=window,
dim=dim,
coord=coord,
)
print(out)
Zeitsperre marked this conversation as resolved.
Show resolved Hide resolved
return out


def last_run_before_date(
Expand Down Expand Up @@ -1350,9 +1352,12 @@ def _index_from_1d_array(indices, array):
invalid = index.isnull()
# NaN-indexing doesn't work, so fill with 0 and cast to int
index = index.fillna(0).astype(int)
# for each chunk of index, take corresponding values from da

da2 = da.rename("__placeholder__")
# No need for coords, we extract by integer index.
# Renaming with no name to fix bug in xr 2024.01.0
tmpname = get_temp_dimname(da.dims, "temp")
da2 = xr.DataArray(da.data, dims=(tmpname,), name=None)
# for each chunk of index, take corresponding values from da
out = index.map_blocks(_index_from_1d_array, args=(da2,)).rename(da.name)
# mask where index was NaN. Drop any auxiliary coord, they are already on `out`.
# Chunked aux coord would have the same name on both sides and xarray will want to check if they are equal, which means loading them
Expand Down