-
Notifications
You must be signed in to change notification settings - Fork 525
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
Support import type annotation from slicer during module load #6847
Merged
jcfr
merged 2 commits into
Slicer:main
from
jcfr:support-import-type-annotation-from-slicer-during-module-load
Mar 3, 2023
Merged
Support import type annotation from slicer during module load #6847
jcfr
merged 2 commits into
Slicer:main
from
jcfr:support-import-type-annotation-from-slicer-during-module-load
Mar 3, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
672426a
to
40cfdab
Compare
03088e7
to
dcfd1e5
Compare
…her modules This commit ensures that python wrapped C++ classes implemented by loadable module (Logic, MRML, MRMLDisplayableManager, VTKWidgets, PythonQt) are imported and associated with the "slicer" package during module instantiation. This ensures that classes that are both provided by other modules and referenced in python script associated with scripted loadable module can be successfully resolved. Note that since wrapped C++ VTK modules explicitly import other wrapped C++ VTK modules they depend one (using vtkPythonUtil::ImportModule), calling qSlicerScriptedUtils::importModulePythonExtensions during module instantiation done independently of the module dependency graph is not a problem.
…ndencies Update test_slicer_parameter_node_wrapper and test_slicer_parameter_pack tests execution options to ensure loadable modules are loaded. This is required to ensure the following imports work: * import of `qMRMLSubjectHierarchyTreeView` in slicer.parameterNodeWrapper.guiConnectors * import of vtkMRML*Node in test_slicer_parameter_node_wrapper
dcfd1e5
to
d1e1004
Compare
LGTM. Tests pass. I was able to import a MRML node from an extension (s-reps) to use as a type hint via the |
Connor-Bowley
approved these changes
Mar 3, 2023
I realized the following tests are failing:
Currently looking into this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit ensures that python wrapped C++ classes implemented by loadable module (Logic, MRML, MRMLDisplayableManager, VTKWidgets, PythonQt) are imported and associated with the "slicer" package during module instantiation.
This ensures that classes that are both provided by other modules and referenced in python script associated with scripted loadable module can be successfully resolved.
Note that since wrapped C++ VTK modules explicitly import other wrapped C++ VTK modules they depend one (using
vtkPythonUtil::ImportModule
), callingqSlicerScriptedUtils::importModulePythonExtensions
during module instantiation done independently of the module dependency graph is not a problem.Original description
Pending:
py_nomainwindow_test_slicer_parameter_node_wrapper