https://github.com/pymmcore-plus/pymmcore-nano
Python bindings for CMMCore (micro-manager) using nanobind instead of SWIG
https://github.com/pymmcore-plus/pymmcore-nano
Last synced: 3 months ago
JSON representation
Python bindings for CMMCore (micro-manager) using nanobind instead of SWIG
- Host: GitHub
- URL: https://github.com/pymmcore-plus/pymmcore-nano
- Owner: pymmcore-plus
- License: lgpl-2.1
- Created: 2024-11-27T12:54:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-03-02T15:41:04.000Z (3 months ago)
- Last Synced: 2026-03-02T17:53:04.537Z (3 months ago)
- Language: C++
- Homepage: https://pymmcore-plus.github.io/pymmcore-nano/
- Size: 8.34 MB
- Stars: 2
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pymmcore-nano
[](https://github.com/pymmcore-plus/pymmcore-nano/raw/main/LICENSE)
[](https://pypi.org/project/pymmcore-nano)
[](https://python.org)
[](https://github.com/pymmcore-plus/pymmcore-nano/actions/workflows/ci.yml)
[](https://codecov.io/gh/pymmcore-plus/pymmcore-nano)
Experimental python bindings for
[CMMCore](https://github.com/micro-manager/mmCoreAndDevices) (the device
abstraction layer for micro-manager) using
[nanobind](https://nanobind.readthedocs.io/en/latest/) instead of SWIG.
This package can be used as a drop-in replacement for
[`pymmcore`](https://pypi.org/project/pymmcore/). There are a few slight
differences in behavior. You are encouraged to try it where you might use
pymmcore; and [let us
know](https://github.com/pymmcore-plus/pymmcore-nano/issues) if you run into any
issues!
## Installation
```sh
pip install pymmcore-nano
# optionally include device adapters commonly used for demos and testing
# (DemoCamera, Utilities, etc...)
pip install 'pymmcore-nano[test-devices]'
```
Versioning is the same as for pymmcore.
```txt
MMCoreMajor.MMCoreMinor.MMCorePatch.DeviceInterface.pymmcore-nano-build
```
For example, the version `11.3.0.71.2` refers to:
- MMCore version 11.3.0
- Device interface 71
- pymmcore-nano build number of 2 (this is a zero indexed version that resets
each time the MMCore or Device Interface versions increment)
## For Developers
### Clone repo
```sh
git clone https://github.com/pymmcore-plus/pymmcore-nano.git
cd pymmcore-nano
```
### Setup dev environment (editable install)
Make sure you have uv installed:
This project uses `just` as a task runner. If you have `just` installed (e.g.
`brew install just`), you can fully setup the project with:
```sh
just install
```
If you prefer not to install `just` globally, you can install it with the rest
of the project dependencies using uv. Then activate the environment and call
`just install`
```sh
uv sync --no-install-project
. .venv/bin/activate # Windows: .venv\Scripts\activate
just install
```
Note that one of the dev dependencies is
[`mm-test-adapters`](https://pypi.org/project/mm-test-adapters/), this brings in
a few device adapters that are useful for testing purposes. (The version of
`mm-test-adapters` should match the device interface version you are building
against.)
### Test
Regardless of whether the environment is active, you can run:
```sh
just test
```
or, if the environment is active and you have already run `just install`
```sh
pytest
```
### Releasing
To release a new version:
- update the `PYMMCORE_NANO_VERSION` value in [`_pymmcore_nano.cc`](./src/_pymmcore_nano.cc)
- run `just version`
- commit changes to main
- run `just release`
### Updating `MMCore` and `MMDevice`
The versions of `MMCore` and `MMDevice` that this project builds against are
pinned in the `subprojects/mmcore.wrap` and `subprojects/mmdevice.wrap` files,
respectively. To build against a new version, update the `revision` field in
the appropriate wrap file and re-run `just install`.
For version changes that bump the Device Interface version, you will also want
to update the version of `mm-test-adapters` in the `pyproject.toml` file.