TheDeanLab / navigate

navigate - open source light-sheet microscope controls
https://thedeanlab.github.io/navigate/
Other
18 stars 5 forks source link

Refactor plugins_model #939

Closed AdvancedImagingUTSW closed 2 weeks ago

AdvancedImagingUTSW commented 1 month ago

In an attempt to write unit tests for the plugins_model, I found the function load_plugins too large to effectively test. So, I tried to break it up into smaller methods, which could then be tested independently.

Also found duplicated code in the plugins_controller, so I created a method of that section of code, and placed it in config.py. Both the plugins model and the plugins controller now load this function...

Will test before moving on to write unit tests...

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 25.24272% with 77 lines in your changes missing coverage. Please review.

Project coverage is 53.53%. Comparing base (1b7e2e9) to head (6d771eb). Report is 3 commits behind head on develop.

Files Patch % Lines
src/navigate/model/plugins_model.py 24.13% 66 Missing :warning:
src/navigate/config/config.py 28.57% 10 Missing :warning:
src/navigate/controller/sub_controllers/plugins.py 50.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #939 +/- ## =========================================== + Coverage 53.51% 53.53% +0.02% =========================================== Files 176 176 Lines 18965 18986 +21 =========================================== + Hits 10149 10165 +16 - Misses 8816 8821 +5 ``` | [Flag](https://app.codecov.io/gh/TheDeanLab/navigate/pull/939/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheDeanLab) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/TheDeanLab/navigate/pull/939/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheDeanLab) | `53.53% <25.24%> (+0.02%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheDeanLab#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

AdvancedImagingUTSW commented 3 weeks ago

@annie-xd-wang - Before you do too much work on making the plugins pip installable, could you review and test this PR?