From 7a3eb30f5ebd4289d7fba5fc62347a61a667ace9 Mon Sep 17 00:00:00 2001 From: Mike Langmayr <1809691+mikelangmayr@users.noreply.github.com> Date: Mon, 28 Sep 2026 11:58:23 -0700 Subject: [PATCH 1/2] Move the camera-interface submodule to extern and name the tracking module --- .gitmodules | 4 ++-- etc/camera-interface | 1 - extern/camera-interface | 1 + src/hispec/driver/tracking_camera/README.md | 18 ++++++++++-------- src/hispec/driver/tracking_camera/camera.py | 2 ++ 5 files changed, 15 insertions(+), 11 deletions(-) delete mode 160000 etc/camera-interface create mode 160000 extern/camera-interface diff --git a/.gitmodules b/.gitmodules index 2238a80..c00e272 100644 --- a/.gitmodules +++ b/.gitmodules @@ -49,8 +49,8 @@ [submodule "etc/PIPython"] path = etc/PIPython url = https://github.com/PI-PhysikInstrumente/PIPython -[submodule "etc/camera-interface"] - path = etc/camera-interface +[submodule "extern/camera-interface"] + path = extern/camera-interface url = https://github.com/CaltechOpticalObservatories/camera-interface branch = main [submodule "src/hispec/driver/pdu"] diff --git a/etc/camera-interface b/etc/camera-interface deleted file mode 160000 index 7e7dd11..0000000 --- a/etc/camera-interface +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7e7dd1177278869f85ef770ec2244b5f995a07b1 diff --git a/extern/camera-interface b/extern/camera-interface new file mode 160000 index 0000000..3d78e4c --- /dev/null +++ b/extern/camera-interface @@ -0,0 +1 @@ +Subproject commit 3d78e4ccc02092f441370488188ec09cfe46f115 diff --git a/src/hispec/driver/tracking_camera/README.md b/src/hispec/driver/tracking_camera/README.md index 34c89bf..fb166de 100644 --- a/src/hispec/driver/tracking_camera/README.md +++ b/src/hispec/driver/tracking_camera/README.md @@ -6,9 +6,9 @@ everything common to any camerad camera. ## Prerequisite -pycamerad wraps `camera_interface`, a pybind11 module built from +pycamerad wraps a pybind11 module built from [camera-interface](https://github.com/CaltechOpticalObservatories/camera-interface), -checked out here as the `etc/camera-interface` submodule. It is a compiled +checked out here as the `extern/camera-interface` submodule. It is a compiled extension built per instrument rather than a package on an index, so it cannot be a dependency in `pyproject.toml` and has to be installed separately. @@ -16,17 +16,19 @@ Install it into whichever environment you run hispec from, alongside hispec itself: ```bash -pip install ./etc/camera-interface \ - --config-settings=cmake.define.INSTRUMENT=hispec_tracking_camera +pip install ./extern/camera-interface/packaging/tracking ``` -Add `--config-settings=cmake.define.ENABLE_SHM_OUTPUT=ON` for the +That package fixes the instrument and names the module +`camera_interface_tracking`, which is what `TrackingCamera.MODULE_NAME` loads. +Building a second instrument under its own name lets both live in one +environment. Add `--config-settings=cmake.define.ENABLE_SHM_OUTPUT=ON` for the shared-memory output, and `cmake.define.ImageStreamIO_DIR=` if ImageStreamIO is not under `/usr/local/lib/cmake`. -`import camera_interface` then works with no `PYTHONPATH`, and `camerad` is on -`PATH` whenever that environment is active. pybind11 is fetched into an -isolated build environment, so it never has to be installed by hand. +The import then works with no `PYTHONPATH`, and `camerad` is on `PATH` +whenever that environment is active. pybind11 is fetched into an isolated +build environment, so it never has to be installed by hand. ### Build dependencies diff --git a/src/hispec/driver/tracking_camera/camera.py b/src/hispec/driver/tracking_camera/camera.py index cf6f15e..93df605 100644 --- a/src/hispec/driver/tracking_camera/camera.py +++ b/src/hispec/driver/tracking_camera/camera.py @@ -52,6 +52,8 @@ def width(self) -> int: class TrackingCamera(Camerad): """The HISPEC tracking camera, adding its instrument commands.""" + MODULE_NAME = "camera_interface_tracking" + ### lifecycle def initialize(self) -> None: From bc69c6007523356cc4ef3ca7333a03486d6eff26 Mon Sep 17 00:00:00 2001 From: Mike Langmayr <1809691+mikelangmayr@users.noreply.github.com> Date: Mon, 28 Sep 2026 13:44:34 -0700 Subject: [PATCH 2/2] Use external for vendored source and move PIPython there too --- .gitmodules | 8 ++++---- {etc => external}/PIPython | 0 {extern => external}/camera-interface | 0 src/hispec/driver/tracking_camera/README.md | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) rename {etc => external}/PIPython (100%) rename {extern => external}/camera-interface (100%) diff --git a/.gitmodules b/.gitmodules index c00e272..5777b22 100644 --- a/.gitmodules +++ b/.gitmodules @@ -46,11 +46,11 @@ path = src/hispec/driver/newport url = https://github.com/COO-Utilities/newport branch = main -[submodule "etc/PIPython"] - path = etc/PIPython +[submodule "external/PIPython"] + path = external/PIPython url = https://github.com/PI-PhysikInstrumente/PIPython -[submodule "extern/camera-interface"] - path = extern/camera-interface +[submodule "external/camera-interface"] + path = external/camera-interface url = https://github.com/CaltechOpticalObservatories/camera-interface branch = main [submodule "src/hispec/driver/pdu"] diff --git a/etc/PIPython b/external/PIPython similarity index 100% rename from etc/PIPython rename to external/PIPython diff --git a/extern/camera-interface b/external/camera-interface similarity index 100% rename from extern/camera-interface rename to external/camera-interface diff --git a/src/hispec/driver/tracking_camera/README.md b/src/hispec/driver/tracking_camera/README.md index fb166de..9ebc5e3 100644 --- a/src/hispec/driver/tracking_camera/README.md +++ b/src/hispec/driver/tracking_camera/README.md @@ -8,7 +8,7 @@ everything common to any camerad camera. pycamerad wraps a pybind11 module built from [camera-interface](https://github.com/CaltechOpticalObservatories/camera-interface), -checked out here as the `extern/camera-interface` submodule. It is a compiled +checked out here as the `external/camera-interface` submodule. It is a compiled extension built per instrument rather than a package on an index, so it cannot be a dependency in `pyproject.toml` and has to be installed separately. @@ -16,7 +16,7 @@ Install it into whichever environment you run hispec from, alongside hispec itself: ```bash -pip install ./extern/camera-interface/packaging/tracking +pip install ./external/camera-interface/packaging/tracking ``` That package fixes the instrument and names the module