Skip to content
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

Package structure and startup time #40

Open
felix-andreas opened this issue Apr 13, 2020 · 0 comments
Open

Package structure and startup time #40

felix-andreas opened this issue Apr 13, 2020 · 0 comments

Comments

@felix-andreas
Copy link
Member

felix-andreas commented Apr 13, 2020

Currently every public object is exposed via the top-level __init__.py. This effects the startup time when importing latticejson as library but also the startup time of the CLI (because it is a submodule and the parent package gets always executed). Maybe it would be better to use the scipy-approach: Keep the Top-level __init__.py empty and use subpackages to import functionality. But this would be somewhat inconvenient for a user...

To solve the issue for the CLI, the cli.py could be installed separately.

Maybe the __getattr__ of PEP 562 can be used to lazy load the submodules into the top-level name space of the __init__.py.

See also:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant