hpcflow / hpcflow-new

Mozilla Public License 2.0
0 stars 5 forks source link

Optimise imports #610

Open aplowman opened 7 months ago

aplowman commented 7 months ago

Some imports can be placed inside a function scope to ensure they do run when not needed. This will improve start-up time.

In hpcflow.sdk.core.actions, h5py is only need in these methods:

In hpcflow.sdk.persistence.utils, paramiko is only needed in the method ask_pw_on_auth_exc.

In hpcflow.sdk.app, find_packages from setuptools is only used in the method BaseApp._load_scripts, which is called by BaseApp._load_template_components, which in turn is called on demand when template components are accessed.