Description
Hi labscripts folks,
First, thank you all for providing such a wonderful experiment framework! Here at JQI, we are actively working on adding new devices to labscripts (strong push from @ispielma ^^). I'm currently finalizing a blacs device for DMDs using ALP 4.1 API (hopefully we can propose a general interface design for DMDs) and also a blacs device for GeniCam.
One technical difficulty I noticed is: every time I add one new device to labscript-devices repo, I will introduce a new bunch of dependencies (and sometimes, unfortunately, some binary files from the manufacturer). If some users don't really need the support of that device, these extra dependencies would just increase the difficulty of deployment.
To solve this problem, I have two solutions to propose:
- Using the namespace package feature of python. With namespace packages, we can separate this huge repo into different submodules that share the same namespace, e.g. we can publish two pip packages
device_a
anddeivce_b
and they can be imported by
import labscript_devices.device_a
import labscript_devices.device_b
both under the namespace labscript_device
. In this way, the dependencies of each device will be maintained independently from other devices.
- I believe the namespace package is the most elegant approach, but I can also foresee that any transition from the current norm would be difficult. As an intermediate approach, we may also consider adding new devices as
git submodule
(one example is the way picosdk managing 3rd party libraries). We can pack all files, including binary files for that module, into an external repo and add that into labscript-devices as a submodule. When users decide to install this module, they only need to rungit submodule update --remote <path to the submodule>
. The downside of this method is it will mess up pip, and users need to manage the dependencies of that submodule by themselves.
Let me know your thoughts about it!