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

Turn live mode off when loading calibration #335

Merged
merged 2 commits into from
Apr 12, 2023

Conversation

talonchandler
Copy link
Collaborator

@talonchandler talonchandler commented Apr 10, 2023

Fixes #280

Tested on hummingbird

@codecov
Copy link

codecov bot commented Apr 10, 2023

Codecov Report

Merging #335 (fbbd7c8) into main (add3280) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

❗ Current head fbbd7c8 differs from pull request most recent head 97df866. Consider uploading reports for the commit 97df866 to get more accurate results

@@           Coverage Diff            @@
##            main    #335      +/-   ##
========================================
- Coverage   2.06%   2.06%   -0.01%     
========================================
  Files         21      21              
  Lines       4888    4890       +2     
========================================
  Hits         101     101              
- Misses      4787    4789       +2     
Impacted Files Coverage Δ
recOrder/plugin/main_widget.py 0.00% <0.00%> (ø)

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

@deprecated-napari-hub-preview-bot

Preview page for your plugin is ready here:
https://preview.napari-hub.org/mehta-lab/recOrder/335
Created: 2023-04-10T23:09:29.294214

@ziw-liu
Copy link
Contributor

ziw-liu commented Apr 11, 2023

To my eyes this is very similar to #282 but glad this worked! @talonchandler maybe also consider using that context manager?

@talonchandler
Copy link
Collaborator Author

It looks like we're using the context manager when we capture a background, and we're using these lines for running a calibration (where I got this from) and now for loading a calibration:

if self.calib.snap_manager.getIsLiveModeOn():
    self.calib.snap_manager.setLiveModeOn(False)

I agree that the context manager should do the same thing, so I don't understand why #282 isn't working.

Do you think it's worth the effort to test and understand this? Or do you think we should merge this fix and handle later?

@ziw-liu
Copy link
Contributor

ziw-liu commented Apr 11, 2023

It seems like #282 didn't work because the load_calibration worker makes MMCore calls directly instead of reusing existing methods of the Calibration object. I can fix that.

Copy link
Contributor

@ziw-liu ziw-liu left a comment

Choose a reason for hiding this comment

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

@talonchandler I'm fine with this PR either way since its just a few lines. It's your call whether we need this quick patch for the 0.3 release, but if you decide to merge maybe comment with FIXME in the code so that we don't forget about it.

@talonchandler
Copy link
Collaborator Author

Thanks for your flexibility @ziw-liu. I've added FIXME comments, and I'm looking forward to moving the MM calls off of the main thread later.

@talonchandler talonchandler added this pull request to the merge queue Apr 12, 2023
Merged via the queue into main with commit 8c400d6 Apr 12, 2023
@ziw-liu ziw-liu deleted the stop-live-when-loading-cal branch April 12, 2023 21:42
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.

"Load calibration" when MM is live gives an error
2 participants