Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 3 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ Changelog
v0.17.0 (unreleased)
--------------------

* Updated the cookiecutter template to the latest commit and synchronized dependencies between PyPI and Anaconda recipes. (PR #427).
* Updated the cookiecutter template to the latest commit and synchronized dependencies between PyPI and Anaconda recipes. (PR #427)
* Updated `ts_fit_graph` logic for `matplotlib` >= 3.10.0 compatibility. (PR #434)
* Temporarily pinned `pygments` below v2.19 due to a breaking change affecting `sphinx-codeautolink`. (PR #434)

v0.16.1 (2024-12-05)
--------------------
Expand Down
2 changes: 1 addition & 1 deletion environment-rtd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies:
- notebook
- pandoc
- pydantic >=2.0
- pygments
- pygments <2.19 # FIXME: Newest pygments breaks sphinx-codeautolink. See: https://github.com/felix-hilden/sphinx-codeautolink/issues/153
- salib
- seaborn
- sphinx >=7.0.0
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ docs = [
"myst_nb",
"nbsphinx",
"numpydoc >=1.8.0",
"pygments",
"pygments <2.19", # FIXME: Newest pygments breaks sphinx-codeautolink. See: https://github.com/felix-hilden/sphinx-codeautolink/issues/153
"pymetalink >=6.5.2",
"salib",
"s3fs",
Expand Down
8 changes: 4 additions & 4 deletions src/ravenpy/utilities/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def ts_fit_graph(ts: xr.DataArray, params: xr.DataArray) -> matplotlib.pyplot.Fi

fig, axes = plt.subplots(n, figsize=(10, 6), squeeze=False)
if params.isnull().any():
raise ValueError("Null values in `params`.")
raise ValueError("Null values found in `params`.")

for i in range(n):
ax = axes.flat[i]
Expand All @@ -348,9 +348,9 @@ def ts_fit_graph(ts: xr.DataArray, params: xr.DataArray) -> matplotlib.pyplot.Fi
)
ax2.hist(
t,
facecolor="none",
bins=bins,
facecolor=(1, 1, 1, 0.01),
edgecolor="gray",
edgecolor="grey",
linewidth=1,
)

Expand All @@ -362,7 +362,7 @@ def ts_fit_graph(ts: xr.DataArray, params: xr.DataArray) -> matplotlib.pyplot.Fi
pdf = dc.pdf(q)

ps = ", ".join([f"{x:.1f}" for x in p.values])
ax.plot(q, pdf, "-", label="{}({})".format(params.attrs["scipy_dist"], ps))
ax.plot(q, pdf, "-", label=f"{params.attrs['scipy_dist']}({ps})")

# Labels
ax.set_xlabel(f"{ts.long_name} (${units2pint(ts.units):~P}$)")
Expand Down
4 changes: 2 additions & 2 deletions tests/test_graphs.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from shutil import copyfile

import numpy as np
import xarray as xr
from xarray import open_dataset
from xclim import set_options
from xclim.indicators.generic import fit, stats

Expand All @@ -17,7 +17,7 @@ def test_ts_fit_graph(self, get_local_testdata, tmp_path):

copyfile(raven_hydrograph, file)

with xr.open_dataset(file) as ds:
with open_dataset(file) as ds:
ts = stats(ds.q_sim, op="max", freq="ME")
with set_options(check_missing="skip"):
p = fit(ts)
Expand Down
Loading