fix: add ANTSRegistrator alias to fix import error - #189
fix: add ANTSRegistrator alias to fix import error#189neuronflow with Copilot wants to merge 2 commits into
Conversation
…init__ Co-authored-by: neuronflow <7048826+neuronflow@users.noreply.github.com>
|
Ah interesting the small S was created by autocomplete and led to the error message. |
There was a problem hiding this comment.
Pull request overview
This PR fixes an import-casing mismatch in the registration package by adding an ANTSRegistrator alias for the existing ANTsRegistrator, eliminating an ImportError for users importing the all-caps variant.
Changes:
- Add
ANTSRegistrator = ANTsRegistratoralias inside the existingtryimport block for the ANTs registrator. - Preserve the existing optional-dependency behavior (when
antspyxis missing, neither symbol is available).
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
MarcelRosier
left a comment
There was a problem hiding this comment.
Why would we need this instead of just importing ANTsRegistrator? in case the name is wrong, just correct it rather than adding an alias
|
For some reason I don't fully understand yet, VSCode autocomplete leads to importing the wrong Caps version, which then leads to code crashes, but I agree, this is not really needed. |
|
let's not merge, this but I am wondering what triggers this wrong code suggestion 🙃 |
from brainles_preprocessing.registration import ANTSRegistratorraised anImportErrorbecause the class was only exported asANTsRegistrator(lowercases).Changes
brainles_preprocessing/registration/__init__.py: addsANTSRegistrator = ANTsRegistratoralias inside thetryblock so both casings resolve correctly; ifantspyxis not installed, neither name is available (existing behavior preserved)