Repository navigation
MMCore: rename {Mock -> Client}DeviceAdapter and use shared_ptr - #1031
Merged
marktsuchida merged 1 commit intoNov 17, 2026
Merged
Conversation
tlambert03
approved these changes
Nov 10, 2026
tlambert03
left a comment
Contributor
There was a problem hiding this comment.
works for me from the perspective of pymmcore-nano unicore!
Remove the "test only" note and rename, for use by pymmcore[-nano] to load Python device adapters. Still labeled "experimental" until we're sure about the API. The adapter object is now taken by `std::shared_ptr` so that the caller (e.g., nanobind bindings) can add a custom deleter instead of manually keeping a reference to keep the object alive. MMCore tests updated for the rename and the `shared_ptr` API. MMCore minor version bumped. Only bumping the minor version even though `loadMockDeviceAdapter()` and `MockDeviceAdapter` were removed: they were documented as testing-only, subject to change, and excluded from the Java and Python bindings. (Assisted by Claude Code; any errors are mine.)
marktsuchida
force-pushed
the
client-device-adapters
branch
from
November 17, 2026 10:57
6f5e305 to
7749568
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove the "test only" note and rename, for use by pymmcore[-nano] to load Python device adapters. Still labeled "experimental" until we're sure about the API.
The adapter object is now taken by
std::shared_ptrso that the caller (e.g., nanobind bindings) can add a custom deleter instead of manually keeping a reference to keep the object alive.MMCore tests updated for the rename and the
shared_ptrAPI.MMCore minor version bumped. Only bumping the minor version even though
loadMockDeviceAdapter()andMockDeviceAdapterwere removed: they were documented as testing-only, subject to change, and excluded from the Java and Python bindings.@tlambert03 This is what I've come up with in lieu of your mock-adapter-ownership-transfer patch. Probably should have been two separate commits (rename and use of
shared_ptr) but oh well....I think
shared_ptris more natural here (and potentially more correct in some edge cases), because ownership of the adapter object is shared between Python and MMCore. Pretty sure nanobind knows how to do that correctly withshared_ptrand that it will simplify the bindings, also becauseshared_ptrcan carry a custom deleter (so intrusive ownership tracking doesn't need to be added to the object itself).