Skip to content
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

Improvements to hypothesis tab #378

Merged
merged 29 commits into from
Aug 9, 2023
Merged

Improvements to hypothesis tab #378

merged 29 commits into from
Aug 9, 2023

Conversation

paddyroddy
Copy link
Collaborator

@paddyroddy paddyroddy commented Aug 7, 2023

This PR is a catch all for various changes related to the napari plugin and things done in the last few days. I'll make a separate issue to test this.

image

@paddyroddy paddyroddy self-assigned this Aug 7, 2023
@paddyroddy paddyroddy marked this pull request as draft August 7, 2023 15:01
@paddyroddy paddyroddy changed the title Don't set widget values in the widgets (as done from file) Improvements to hypothesis tab Aug 7, 2023
@deprecated-napari-hub-preview-bot
Copy link

deprecated-napari-hub-preview-bot bot commented Aug 7, 2023

Preview page for your plugin is ready here:
https://preview.napari-hub.org/quantumjot/btrack/378
Updated: 2023-08-09T10:20:43.966561

@paddyroddy paddyroddy linked an issue Aug 8, 2023 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Aug 8, 2023

Codecov Report

Patch coverage: 76.76% and project coverage change: +0.47% 🎉

Comparison is base (b088dbf) 85.02% compared to head (fc9bb9c) 85.50%.
Report is 2 commits behind head on main.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #378      +/-   ##
==========================================
+ Coverage   85.02%   85.50%   +0.47%     
==========================================
  Files          26       31       +5     
  Lines        1863     2207     +344     
  Branches      338      404      +66     
==========================================
+ Hits         1584     1887     +303     
- Misses        210      236      +26     
- Partials       69       84      +15     
Files Changed Coverage Δ
btrack/core.py 83.25% <0.00%> (-0.75%) ⬇️
btrack/napari/main.py 65.15% <0.00%> (-1.01%) ⬇️
btrack/napari/writer.py 0.00% <0.00%> (ø)
btrack/utils.py 83.83% <79.31%> (ø)
btrack/config.py 96.82% <100.00%> (ø)
btrack/constants.py 100.00% <100.00%> (ø)
btrack/datasets.py 86.84% <100.00%> (+1.99%) ⬆️
btrack/napari/reader.py 75.00% <100.00%> (+1.66%) ⬆️
btrack/napari/sync.py 94.33% <100.00%> (+0.22%) ⬆️
btrack/napari/widgets/_general.py 100.00% <100.00%> (ø)
... and 2 more

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@quantumjot quantumjot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I think everything is working

btrack/napari/widgets/_general.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@p-j-smith p-j-smith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's looking good! You can add a callback with the other ones to disable the Optimiser tab when enable optimisation is unchecked:

btrack_widget.enable_optimisation.toggled.connect(
    lambda is_checked: btrack_widget._tabs.setTabEnabled(2, is_checked)
)

@paddyroddy
Copy link
Collaborator Author

it's looking good! You can add a callback with the other ones to disable the Optimiser tab when enable optimisation is unchecked:

btrack_widget.enable_optimisation.toggled.connect(
    lambda is_checked: btrack_widget._tabs.setTabEnabled(2, is_checked)
)

Separate PR

Co-authored-by: Alan R Lowe <[email protected]>
Comment on lines +83 to +89
# Disable the Optimiser tab if unchecked
for tab in range(btrack_widget._tabs.count()):
if btrack_widget._tabs.tabText(tab) == "Optimiser":
break
btrack_widget.enable_optimisation.toggled.connect(
lambda is_checked: btrack_widget._tabs.setTabEnabled(tab, is_checked)
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the best way I could get it without relying on index @p-j-smith

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paddyroddy I think that's an okay way to do it. Or if you prefer you can get the index of one of the tabs using the widget we put in that tab. As we're not storing the widget itself, you could use one of the child widgets (e.g. hypotheses) and find its parent:

optimiser_tab_index = btrack_widget._tabs.indexOf(btrack_widget.hypotheses.parentWidget())

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I saw that, but I'm not convinced it's any better! Especially as some widgets have moved tabs

@paddyroddy
Copy link
Collaborator Author

Now looks like this. Decided to also shrink the logo and move Track above the config so it is always visible. Will now write some tests #388
image

@paddyroddy paddyroddy merged commit e2ee8d8 into main Aug 9, 2023
13 checks passed
@paddyroddy paddyroddy deleted the fix-issue-371 branch August 9, 2023 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Values in Optimiser tab aren't being updated from config
4 participants