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

Lazy processor import #95

Open
gipert opened this issue Nov 10, 2024 · 1 comment
Open

Lazy processor import #95

gipert opened this issue Nov 10, 2024 · 1 comment
Labels
enhancement New feature or request question Further information is requested

Comments

@gipert
Copy link
Member

gipert commented Nov 10, 2024

Since now the pre-compilation takes really long, maybe we could make it lazy (e.g. pre-compile a processor only when actually requested)?

@gipert gipert added enhancement New feature or request question Further information is requested labels Nov 10, 2024
@iguinn
Copy link
Collaborator

iguinn commented Jan 17, 2025

Numba is capable of this with JIT compiling, but since we are using guvectorize and being very specific about function signatures, I can't find a way to do this with numba specifically.

There is this package: https://pypi.org/project/lazy-imports/. It seems actively maintained, but it would be adding a dependency.

One big risk to lazy importing is that the compilation could happen concurrently (this was causing a bug before with snakemake which we fixed by making sure to compile things before the dsp workflow got started). Another option could be to have compilation happen during setup; this would mean installation would take much longer, but importing wouldn't (unless you are actively developing). It would also make it so that the cached functions would be installed in the global site-packages in our containers, which might be a good thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants