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

Suggestion: Move imports to local scope #494

Open
zain-sohail opened this issue Aug 24, 2024 · 3 comments
Open

Suggestion: Move imports to local scope #494

zain-sohail opened this issue Aug 24, 2024 · 3 comments

Comments

@zain-sohail
Copy link
Member

Due to how the current interface works, all possible dependencies are imported when importing SedProcessor from sed.

I propose we remove the linter for module level imports and import them in scope when necessary. This will reduce first time importing time from ~30 s to something more managable.

@rettigl
Copy link
Member

rettigl commented Oct 22, 2024

For me, it takes typically 10s max to load. As anyways all calibrators are loaded with the processor, I don't see that we would gain much.

@zain-sohail
Copy link
Member Author

It's about the same for me, except it's much longer on maxwell somehow.

But the main reason I suggested this is for when I am manually testing changes in code, it takes 10 s everytime, even if I load a different module such as config. This is because SedProcessor is loaded automatically and that loads all the subpackages not necessary for the submodule being tested/used. I've also frequently used the io feature standalone to save or load from tiff/h5 etc. so from a user perspective, I find that also useful.

@rettigl
Copy link
Member

rettigl commented Dec 3, 2024

Please go ahead and make a PR for this if you want.

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

2 participants