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

Import in BaseModel.__init__ method instead of at the top of the file #206

Open
jhlegarreta opened this issue Jun 8, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@jhlegarreta
Copy link
Collaborator

What happened?

The base imports a module:

from importlib import import_module

within the __iinit__ method of the BaseModel class:
https://github.com/nipreps/eddymotion/blob/main/src/eddymotion/model/base.py#L135

If that is done for performance reasons, would lazy loading help so that the import is put at the top of the file (if that is relevant)?

What command did you use?

None.

What version of the software are you running?

main

How are you running this software?

Docker

Is your data BIDS valid?

Yes

Are you reusing any previously computed results?

No

Please copy and paste any relevant log output.

Not applicable.

Additional information / screenshots

No response

@jhlegarreta jhlegarreta added the bug Something isn't working label Jun 8, 2024
@oesteban
Copy link
Member

This is intended to allow using virtually any DIPY model with a minimal boilerplate. I agree it delays errors if DIPY is not installed or in an incompatible version. That could be tested at the top, certainly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants