Problem Description
Importing modules from SymPDE is slow and should be speeded up.
One of the reasons is that some of our modules import lots of code from third-party libraries, which is not needed in most cases. For example, file sympde/utilities/utils.py starts with
import numpy as np
import itertools as it
from sympy import lambdify
from mpl_toolkits.mplot3d import *
import matplotlib.pyplot as plt
where the 3D matplotlib imports are only needed by the plot function plot_3d in the module, and not by lambdify_sympde. Moreover, there is no need to import everything with import *.
Suggested Solution
- Do not use:
from ... import *
- Move slow imports into function definition
Problem Description
Importing modules from SymPDE is slow and should be speeded up.
One of the reasons is that some of our modules import lots of code from third-party libraries, which is not needed in most cases. For example, file
sympde/utilities/utils.pystarts withwhere the 3D matplotlib imports are only needed by the plot function
plot_3din the module, and not bylambdify_sympde. Moreover, there is no need to import everything withimport *.Suggested Solution
from ... import *