Add plugin discovery#22
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22 +/- ##
=======================================
Coverage 99.72% 99.72%
=======================================
Files 18 19 +1
Lines 726 730 +4
=======================================
+ Hits 724 728 +4
Misses 2 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Getting a chance to take a closer look at this now - this looks good to me. If I am understanding how it works, the plugin would be installed in the environment / part of the Theoretically, the plugin can be anything, but taking the DWI figure generation as an example - if it were to be a plugin, it'd be a package named niftyone/src/niftyone/__init__.py Lines 8 to 13 in 9a301ef |
|
My thought was that the plugin code would mirror the internal code, so that it would be the plugin code's responsibility to inherit from the relevant base classes and then register. The benefit is that we don't need to do anything other than just import the plugin modules. Ofc we will want to document this, but I think the documentation can wait until things are a bit more crystallized. |
|
Ahh that does make sense. I think I changed this in the PR that merges into this one, but that is an easy enough change to switch it back. |
We need some way to discover user defined figures outside of the main niftyone namespace. This adds a very basic plugin discovery based on the naming convention
niftyone_{plugin_name}. See the python packaging guide.