Skip to content

Commit 9531e7f

Browse files
committed
Use np.isin instead of np.in1d to fix numpy 2.4 test compatibility
https://numpy.org/devdocs/release/2.4.0-notes.html#removed-numpy-in1d
1 parent a2ecc5c commit 9531e7f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/test_optional/test_px/test_px.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test_custom_data_scatter(backend):
3636
)
3737
for data in fig.data:
3838
assert np.all(
39-
np.in1d(data.customdata[:, 1], iris.get_column("petal_width").to_numpy())
39+
np.isin(data.customdata[:, 1], iris.get_column("petal_width").to_numpy())
4040
)
4141
# Hover and custom data, no repeated arguments
4242
fig = px.scatter(

tests/test_optional/test_px/test_px_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def test_sunburst_treemap_with_path_color(constructor):
307307
fig = px.sunburst(
308308
df.to_native(), path=path, color="sectors", color_discrete_map=cmap
309309
)
310-
assert np.all(np.in1d(fig.data[0].marker.colors, list(cmap.values())))
310+
assert np.all(np.isin(fig.data[0].marker.colors, list(cmap.values())))
311311

312312
# Numerical column in path
313313
df = (

0 commit comments

Comments
 (0)