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

Removal of ANTsImage from top level import #699

Closed
FIrgolitsch opened this issue Aug 20, 2024 · 3 comments · Fixed by #700
Closed

Removal of ANTsImage from top level import #699

FIrgolitsch opened this issue Aug 20, 2024 · 3 comments · Fixed by #700

Comments

@FIrgolitsch
Copy link

FIrgolitsch commented Aug 20, 2024

Hello,

I've been using ANTsPy in a toolkit I've developed for our lab. In the last version, the ANTsImage class no longer gets imported to the top level of the packages (i.e. I can't use the reference ants.ANTsImage anymore). Is there a reason for this change? I used the type a lot for type hints within the package. Will it now be stable for the future as well? I don't mind updating my toolkit but the change was not documented in any of the commit messages I saw for the update from 0.5.2 to 0.5.3. When importing the class directly from ants.core.ants_image.py I also get a warning that I'm accessing protected members, as the class is not declared in all of the file.

Kind Regards

@cookpa
Copy link
Member

cookpa commented Aug 20, 2024

Thanks for reporting, I think this happened because of changes in the imports in the sub-package __init__.py. I will take a look

@FIrgolitsch
Copy link
Author

FIrgolitsch commented Aug 20, 2024

Thank you very much for the quick reply! I think if it's added the all array of the ants_image.py file it should work fine again if that's in line with how you want to structure the package.

@cookpa
Copy link
Member

cookpa commented Aug 20, 2024

All except the top-level init file now avoid the "from X import *" pattern (#373). I agree though it should go back into __all__ in case others do the import that way. I will also add it to core/__init__.py

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

Successfully merging a pull request may close this issue.

2 participants