Skip to content

Lazy load SciPy when moving minimum req to 1.9 #348

@prisae

Description

@prisae

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions