-
Notifications
You must be signed in to change notification settings - Fork 47
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
pypesto import is slow #934
Comments
|
that's ofc bad. thought we had fixed that already, but how do all the optimizers and samplers come in again? |
a big chunk comes from pypesto.visualize |
ok .visualize internally refers to at least .sample and .profile (which in turn refers to .optimize) for utility methods. Thus, we need to either
|
Thanks for checking.
👍 I didn't check in detail, but I guess a big part can be resolved by moving some imports under |
I guess actually importing pymc, julia, emcee, nlopt etc only at the beginning of the respective classes' |
Reduced in #946 from 19s to 3.5s on my system. Further improvements could be gained from not importing .visualize by default (2s), and not auto-importing amici+petab, which are main culprits according to
|
Thanks. Sounds much better already.
In favor of not importing those by default. |
So you would also not import amici+petab by default? Then there'd be two options: Either not auto-import e.g. |
Yes, I think it's fair to require from |
For the petab submodule that's already the case, it would rather affect |
amici should not be imported by default, only when importing the PetabImporter. With the current state if #946, import takes about 3s for me. Much better, but removing amici (1.5s import time) would be preferable. |
python -c "import pypesto"
takes 7s on my computer.python -c "import scipy"
takes 0.5s on my computer.I think we should think more carefully about what is imported in
pypesto/__init__.py
The text was updated successfully, but these errors were encountered: