Skip to content

Discussion of callback system in MMCore #164

@ianhi

Description

@ianhi

There has been some scattered discussion of whether new callbacks should added in a python wrapper or directly to the C++ core. I'd like to suggest using this issue as a place to centralize that and work out the future of potential new callbacks in MMCore.

My use case is that I want to interact with microscopes in the following way:

  • I open jupyter lab
  • From that notebook I launch napari-micromanager
  • I do a mix of scripting in the notebook, control of the microscope by hand, and control through the napari GUI

As far as I can tell this mixed methods approach means that in order to keep both the GUI and script up to date on the current state of harware/core state there will need to be a decent number of new signals introduced.

In a dream world it would be easy to add these to the C++ core as it would benefit all downstream users and be standardized. However, this brings a higher development cost than adding them to Python. That development cost is surmountable, but I think that @marktsuchida raised some important concerns in #150 (comment) and #150 (comment)

Before I go off and try to start implementing signals somewhere it would be nice to work out what the best approach would be. To that end I think some of the key questions are:

  1. Do we try to put new callbacks in here - or should they go into python bindings/other wrappers?
    • If they go on the python side where do they actually live?
  2. If they live in C++ should the approach to callbacks be changed at all or is some re-architecturing in order?
    • Consider this quote from Add snap() method #150:

      "Although it would be nice if MMCore worked more like a general event dispatch mechanism, with more consistent behavior, unfortunately that work has not been done, and I'm not sure it would be best to try to accomplish that within its current (one might say broken) architecture."

  3. What callbacks should added/what is the standard for addition of a callback?

Downstream users (that I'm aware of):
Python: @tlambert03 @fdrgsp @ianhi @oeway
Python/Java: @henrypinkard
Java: All already watching this repo I believe :)
C/C++: @dpshepherd (I think c++?), @tractatus

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions