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

Add a new SequenceAcquisition event signals #115

Merged
merged 31 commits into from
Apr 21, 2022

Conversation

fdrgsp
Copy link
Contributor

@fdrgsp fdrgsp commented Mar 12, 2022

This PR adds three new SequenceAcquisition event signals:

startContinuousSequenceAcquisition = Signal() # when continuousSequenceAcquisition is started
startSequenceAcquisition = Signal(str, int, float, bool) # when SequenceAcquisition is started
stopSequenceAcquisition = Signal(str) # when (Continuous)SequenceAcquisition is stopped

and three methods to the core to implement the above signals:

  • startContinuousSequenceAcquisition()
  • startSequenceAcquisition()
  • stopSequenceAcquisition()

linked to PR https://github.com/tlambert03/napari-micromanager/pull/148

@codecov
Copy link

codecov bot commented Mar 12, 2022

Codecov Report

Merging #115 (78b7995) into main (667d92f) will increase coverage by 0.22%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #115      +/-   ##
==========================================
+ Coverage   88.45%   88.68%   +0.22%     
==========================================
  Files          33       33              
  Lines        1447     1476      +29     
==========================================
+ Hits         1280     1309      +29     
  Misses        167      167              
Impacted Files Coverage Δ
pymmcore_plus/core/_mmcore_plus.py 90.10% <100.00%> (+0.57%) ⬆️
pymmcore_plus/core/events/_protocol.py 90.62% <100.00%> (+0.96%) ⬆️
pymmcore_plus/core/events/_psygnal.py 100.00% <100.00%> (ø)
pymmcore_plus/core/events/_qsignals.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 667d92f...78b7995. Read the comment docs.

@ianhi
Copy link
Collaborator

ianhi commented Mar 13, 2022

oooh actually what do you think about adding this directly to MMCore? I'lll ask over there as well.

@ianhi
Copy link
Collaborator

ianhi commented Mar 13, 2022

See micro-manager/mmCoreAndDevices#179 - even if they do get added there we will need to make some changes here.

Having looked at that little more carefully I also think we probably can't get away with just one signal here. I think we need both a started and stopped signal are necessary as we should have the parameters of the startedsequence emitted in the started signal.

We also need to be careful here to maintain the typing overloads on startSequenceAcquistion:

https://github.com/micro-manager/pymmcore/blob/5fb6ad14a57d2b10b57d04bc7706ff56f1162c9c/pymmcore/__init__.pyi#L924-L931

which should also get re-implemented here to as they will emit different signals than the continuous variant. Difference are somewhat described here: micro-manager/mmCoreAndDevices#171 (comment) also helpful to look directly at the implementations:

startSequenceAcquisition
startContinuousSequenceAcquisition

@tlambert03
Copy link
Member

I agree with all of @ianhi's comments. Also think we can add this before any upstream changes are made... (but, it would be ideal if we could somehow anticipate the exact event/callback names that might be used upstream so our API wouldn't change).

I also agree about the typing of the methods, and also think that we should just use the same method names (rather than Sequence -> Seq

@tlambert03
Copy link
Member

plus... tests :)

@fdrgsp fdrgsp changed the title Add a new continuousSequenceAcquisition event signals Add a new SequenceAcquisition event signals Apr 18, 2022
@tlambert03 tlambert03 merged commit ac338fe into pymmcore-plus:main Apr 21, 2022
@fdrgsp fdrgsp deleted the new_signals branch May 27, 2024 19:03
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.

None yet

3 participants