Skip to content

Commit b009b25

Browse files
authored
Merge pull request #5483 from Mr-Neutr0n/fix-numpy-percentile-issue-5461
Fix numpy 2.4.0 compatibility in create_violin()
2 parents d28f18e + 12846fc commit b009b25

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
44

55
## Unreleased
66

7+
### Fixed
8+
- Update `numpy.percentile` syntax to stop using deprecated alias [[5483](https://github.com/plotly/plotly.py/pull/5483)], with thanks to @Mr-Neutr0n for the contribution!
9+
- `numpy` with a version less than 1.22 is no longer supported.
10+
711
## [6.6.0] - 2026-03-02
812

913
### Fixed

plotly/figure_factory/_violin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ def calc_stats(data):
1717
x = np.asarray(data, float)
1818
vals_min = np.min(x)
1919
vals_max = np.max(x)
20-
q2 = np.percentile(x, 50, interpolation="linear")
21-
q1 = np.percentile(x, 25, interpolation="lower")
22-
q3 = np.percentile(x, 75, interpolation="higher")
20+
q2 = np.percentile(x, 50, method="linear")
21+
q1 = np.percentile(x, 25, method="lower")
22+
q3 = np.percentile(x, 75, method="higher")
2323
iqr = q3 - q1
2424
whisker_dist = 1.5 * iqr
2525

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ dependencies = [
3939
]
4040

4141
[project.optional-dependencies]
42-
express = ["numpy"]
42+
express = ["numpy>=1.22"]
4343
kaleido = ["kaleido>=1.1.0"]
4444
dev_core = [
4545
"pytest",
@@ -54,14 +54,14 @@ dev_build = [
5454
]
5555
dev_optional = [
5656
"plotly[dev_build]",
57+
"plotly[express]",
5758
"plotly[kaleido]",
5859
"anywidget",
5960
"colorcet",
6061
# fiona>1.9.6 is not compatible with geopandas<1; geopandas>=1 is not compatible with python 3.8
6162
"fiona<=1.9.6;python_version<='3.8'",
6263
"geopandas",
6364
"inflect",
64-
"numpy",
6565
"orjson",
6666
"pandas",
6767
"pdfrw",

uv.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)