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

Scatter plot extremely slow on Windows with 1.12<scipy<1.15 #475

Open
jsmariegaard opened this issue Dec 5, 2024 · 5 comments
Open

Scatter plot extremely slow on Windows with 1.12<scipy<1.15 #475

jsmariegaard opened this issue Dec 5, 2024 · 5 comments

Comments

@jsmariegaard
Copy link
Member

At least two known installations of modelskill on Windows have extremely slow scatter plots (+1min) if show_density=True (which is the default). If show_density=False then speed is good (<1s) same if bins is set to a low number.

Python 3.13.0

matplotlib==3.9.2
mikecore==0.2.2
mikeio==2.1.2
modelskill==1.0.0
numpy==2.1.3
pandas==2.2.3
scipy==1.14.1
xarray==2024.10.0
ipykernel==6.29.5

@jsmariegaard
Copy link
Member Author

I now tested different versions of scipy, and the problems start from version 1.13.0. The previous scipy version 1.12.0 (with NumPy 1.26.4) works fine.

@jsmariegaard
Copy link
Member Author

The problem is this line:

Z_grid = interpolate.griddata((xg, yg), hist, (x, y), method=method)

And the call to https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.griddata.html

--

The problem can be partly alleviated by using fewer number of bins:

cmp.plot.scatter(bins=40)   # default is 120

Or to not show the points with show_points=False or show fewer points show_points=1000.

@jsmariegaard jsmariegaard changed the title Scatter plot extremely slow in some installations Scatter plot extremely slow on Windows with scipy>1.12 Dec 12, 2024
@ecomodeller
Copy link
Member

Is this problem specific to Windows?

@jsmariegaard
Copy link
Member Author

Is this problem specific to Windows?

As far as I know. I don't have the same problem in WSL. I don't know why

@jsmariegaard
Copy link
Member Author

Great news - seems to be resolved with the most recent version of scipy==1.15 released one week ago 😌

@jsmariegaard jsmariegaard changed the title Scatter plot extremely slow on Windows with scipy>1.12 Scatter plot extremely slow on Windows with 1.12<scipy<1.15 Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants