Skip to content
Closed
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: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased

### Fixed
- Fix pytest 9 compatibility: use `collection_path` instead of deprecated `path` argument in `pytest_ignore_collect` hook
- Fix NumPy 2.0 compatibility: use `method` instead of deprecated `interpolation` in `np.percentile` and `np.isin` instead of `np.in1d`

## [6.5.2] - 2026-01-14

### Fixed
Expand Down
10 changes: 6 additions & 4 deletions plotly/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import os
from pathlib import Path


def pytest_ignore_collect(path):
def pytest_ignore_collect(collection_path: Path):
# Ignored files, most of them are raising a chart studio error
ignored_paths = [
"exploding_module.py",
Expand All @@ -16,9 +17,10 @@ def pytest_ignore_collect(path):
"presentation_objs.py",
"session.py",
]
path_str = str(collection_path)
if (
os.path.basename(str(path)) in ignored_paths
or "plotly/plotly/plotly/__init__.py" in str(path)
or "plotly/api/utils.py" in str(path)
collection_path.name in ignored_paths
or "plotly/plotly/plotly/__init__.py" in path_str
or "plotly/api/utils.py" in path_str
):
return True
6 changes: 3 additions & 3 deletions plotly/figure_factory/_violin.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ def calc_stats(data):
x = np.asarray(data, float)
vals_min = np.min(x)
vals_max = np.max(x)
q2 = np.percentile(x, 50, interpolation="linear")
q1 = np.percentile(x, 25, interpolation="lower")
q3 = np.percentile(x, 75, interpolation="higher")
q2 = np.percentile(x, 50, method="linear")
q1 = np.percentile(x, 25, method="lower")
q3 = np.percentile(x, 75, method="higher")
iqr = q3 - q1
whisker_dist = 1.5 * iqr

Expand Down
2 changes: 1 addition & 1 deletion tests/test_optional/test_px/test_px.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_custom_data_scatter(backend):
)
for data in fig.data:
assert np.all(
np.in1d(data.customdata[:, 1], iris.get_column("petal_width").to_numpy())
np.isin(data.customdata[:, 1], iris.get_column("petal_width").to_numpy())
)
# Hover and custom data, no repeated arguments
fig = px.scatter(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_optional/test_px/test_px_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def test_sunburst_treemap_with_path_color(constructor):
fig = px.sunburst(
df.to_native(), path=path, color="sectors", color_discrete_map=cmap
)
assert np.all(np.in1d(fig.data[0].marker.colors, list(cmap.values())))
assert np.all(np.isin(fig.data[0].marker.colors, list(cmap.values())))

# Numerical column in path
df = (
Expand Down