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

Lazy load SciPy when moving minimum req to 1.9 #348

Open
prisae opened this issue Feb 23, 2024 · 0 comments
Open

Lazy load SciPy when moving minimum req to 1.9 #348

prisae opened this issue Feb 23, 2024 · 0 comments

Comments

@prisae
Copy link
Member

prisae commented Feb 23, 2024

Just something to keep in mind: From SciPy>=1.9 onwards, we can do, e.g.,

import scipy as sp

def myfunc():
    sp.interpolate.xyz
    sp.integrate.xyz
    ...

The submodules, e.g., interpolate, are lazy loaded within SciPy>=1.9. Before that, one had to do

from scipy import interpolate
from scipy import integrate
...

Using this throughout would save roughly 50% of the import time of discretize (crucial for the responsiveness of CLI tools that use discretize).

Selection_002

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

1 participant