-
Notifications
You must be signed in to change notification settings - Fork 23
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
Defer some third-party imports for quicker high-level imports #1085
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, we could defer loading
openff.toolkit.ForceField
but that seems obtuse
A little, but my inclination would be to do it:
- it's almost all of the remaining import time according to your graphic (if it ends up being imported anyway I wouldn't bother)
- there are some workflows in important growth areas that I don't believe need
ForceField
:- workflows importing from OpenMM or Foyer and not using any SMIRNOFF force field
- workflows loading a previously created Interchange directly from disk (this may be important for determinism)
- the API points that need it all take it as an argument and call methods on it, so it's going to be imported by the user in most cases, which means complaints about import times will probably go to the right place
Other than that, this LGTM! I have a suggestion about indicating type aliases more explicitly that may or may not make the type checker happier but it's entirely optional.
Co-authored-by: Josh A. Mitchell <[email protected]>
Description
Resolves #239, for now?
I mean, we could defer loading
openff.toolkit.ForceField
but that seems obtuseChecklist