8000 refactor: optimize CLI actions by Czaki · Pull Request #772 · 4DNucleome/PartSeg · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor: optimize CLI actions #772

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

Merged
merged 7 commits into from
Oct 26, 2022
Merged

refactor: optimize CLI actions #772

merged 7 commits into from
Oct 26, 2022

Conversation

Czaki
Copy link
Collaborator
@Czaki Czaki commented Oct 24, 2022

speedup CLI show by delay imports

@Czaki Czaki added this to the v0.14.4 milestone Oct 24, 2022
@sourcery-ai
Copy link
Contributor
sourcery-ai bot commented Oct 24, 2022

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.82%.

Quality metrics Before After Change
Complexity 2.41 ⭐ 2.43 ⭐ 0.02 👎
Method Length 51.70 ⭐ 51.69 ⭐ -0.01 👍
Working memory 6.55 🙂 7.08 🙂 0.53 👎
Quality 74.99% 🙂 74.17% 🙂 -0.82% 👎
Other metrics Before After Change
Lines 584 597 13
Changed files Quality Before Quality After Quality Change
examples/convert_tiff_mask_to_projets.py 76.05% ⭐ 68.78% 🙂 -7.27% 👎
package/PartSeg/launcher_main.py 56.34% 🙂 55.86% 🙂 -0.48% 👎
package/PartSeg/common_backend/init.py 93.04% ⭐ 92.22% ⭐ -0.82% 👎
package/PartSeg/common_backend/base_argparser.py 78.06% ⭐ 77.61% ⭐ -0.45% 👎
package/PartSegCore/segmentation/threshold.py 81.08% ⭐ 81.00% ⭐ -0.08% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
package/PartSeg/launcher_main.py select_window 10 🙂 185 😞 14 😞 43.28% 😞 Try splitting into smaller methods. Extract out complex expressions
package/PartSeg/launcher_main.py main 5 ⭐ 264 ⛔ 13 😞 44.44% 😞 Try splitting into smaller methods. Extract out complex expressions
package/PartSegCore/segmentation/threshold.py SitkThreshold.calculate_mask 8 ⭐ 159 😞 13 😞 48.94% 😞 Try splitting into smaller methods. Extract out complex expressions
package/PartSegCore/segmentation/threshold.py MultipleOtsuThreshold.calculate_mask 7 ⭐ 138 😞 10 😞 57.34% 🙂 Try splitting into smaller methods. Extract out complex expressions
package/PartSegCore/segmentation/threshold.py MultipleOtsu.calculate_mask 2 ⭐ 150 😞 9 🙂 62.98% 🙂 Try splitting into smaller methods

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@Czaki Czaki modified the milestones: v0.14.4, v0.14.5 Oct 24, 2022
@deprecated-napari-hub-preview-bot
Copy link
deprecated-napari-hub-preview-bot bot commented Oct 24, 2022

Preview page for your plugin is ready here:
https://preview.napari-hub.org/4DNucleome/PartSeg/772
Updated: 2022-10-26T10:08:42.152841

@codecov
Copy link
codecov bot commented Oct 24, 2022

Codecov Report

Base: 89.46% // Head: 89.64% // Increases project coverage by +0.17% 🎉

Coverage data is based on head (a847be4) compared to base (9e742fc).
Patch coverage: 73.91% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #772      +/-   ##
===========================================
+ Coverage    89.46%   89.64%   +0.17%     
===========================================
  Files          192      192              
  Lines        29678    29550     -128     
===========================================
- Hits         26552    26490      -62     
+ Misses        3126     3060      -66     
Impacted Files Coverage Δ
package/PartSeg/launcher_main.py 42.24% <33.33%> (+42.24%) ⬆️
package/PartSeg/common_backend/__init__.py 100.00% <100.00%> (ø)
package/PartSeg/common_backend/base_argparser.py 100.00% <100.00%> (ø)
package/PartSegCore/segmentation/threshold.py 98.10% <100.00%> (-0.02%) ⬇️
package/tests/test_PartSeg/test_launcher.py 100.00% <100.00%> (ø)
package/tests/conftest.py
package/PartSeg/common_gui/main_window.py 87.23% <0.00%> (+0.42%) ⬆️
package/PartSeg/_roi_mask/main_window.py 64.51% <0.00%> (+0.57%) ⬆️
package/PartSeg/_roi_analysis/main_window.py 71.65% <0.00%> (+0.79%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@lgtm-com
Copy link
lgtm-com bot commented Oct 26, 2022

This pull request introduces 1 alert when merging 09109f9 into 944ade4 - view on LGTM.com

new alerts:

  • 1 for Module is imported with 'import' and 'import from'

@Czaki Czaki merged commit 37b4578 into develop Oct 26, 2022
@Czaki Czaki deleted the refactor/speedup_show_help branch October 26, 2022 10:58
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 this pull request may close these issues.

1 participant
0