New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additional repository for DLL/COM devices? #1058
Comments
I agree that they are not a good fit, as they won't need most of the data/command string wrangling features that we provide. However, common abstractions like #416 could still be useful for them. One approach could be to hide all the dll/COM stuff behind a custom adapter, define the properties with the usual command strings, and have the adapter's read and write trigger calls of the appropriate dll functions (e.g. with pattern matching from py310) on the command string. I agree that we should not pull these driver binaries (and any associated dependencies) into pymeasure itself, this is a scope limitation for pymeasure that I fully agree with. However, what we might be able to do is to define and document a "plugin" format, where we could allow others to implement and maintain such drivers in a separate package, but allow them to add into e.g. a Maybe one way to prototype/try this is to pull the NI things we talked about removing (can't find the issue right now) into such a plugin, and see how that works out? Not sure if we then want to maintain it, though. Considering our workload, I would say we should not spend too much effort on these out of scope instrument types. |
Thanks for your ideas
It's #662, I added it to the history section in the initial post.
I agree. |
@BenediktBurger, I think I understand your question, but I am afraid I have no proposal except, perhaps, to avoid supporting such kind of instruments.
I think we all agree on these points and sadly I have no proposal how to handle the proposal. |
The problem is, that for some instruments, you have to use external binary code and you have to write your python code around that. It's sad, that it is so difficult to share that work. |
I'm interested in that discussion also because for pymodaq development of some plugins we had to develop our own python driver on top of many DLLs/COM/.Net libraries. Ah the moment we keep those into the corresponding manufacturer plugin together with the actual pymodaq plugin using this driver. But it's sad as not all people can easily benefit from that work as there is no clear visibility of such driver. On the other hand, more and more. Manufacturer are offering python driver of their own dll, making the need of such a work a bit less important... |
What about a single Repository per manufacturer (if there is no python repo yet), maybe under the pymeasure organization. Whenever someone wants to maintain one Repository, he may do so. The quality of these repositories will vary, but it will be available for people to use. As they are part of the pymeasure organization (or some other), the pymeasure organization may appoint new maintainers, if the previous one does not respond anymore. |
I'm ok with this as pymeasure already has good visibility for its drivers. Is there some kind of base class/interface that would be nice to have for those? |
I like the name space approach and prefer it over a mere naming convention (starting with "pymeasure_".
A base class is difficult, as these instruments differ a lot. Using a template Repository (like pymodaq plug-ins template), could be useful, though. |
The naming convention is useful if you want to browse automatically pypi for compatible plugins, what I did for pymodaq. Especially because plugins could be hosted under different accounts or organisations. Once the package is installed, the entry points mechanism is really nice to discover and expose compatible objects. For instance instrument classes, ... |
Thanks for your comment and thanks for joining the discussion. |
I do not have a clear idea what the best approach would be. |
Especially with the "one repo per manufacturer, in the pymeasure org" approach, I'm concerned we will end up with N (potentially >>1) repositories in our org that will become basically unmaintained and put an undue attention load on us (what we can ill afford) for a kind of driver that is kinda out of scope for pymeasure. I'd rather we
Then, if there is a plugin with a lot of interest and a stable maintenance situation, we can always pull it into the pymeasure org later (but the other way round will be harder to justify). OTOH, pooling developer effort in the org, and have all the permissions etc sorted out in a failsafe manner if a maintainer disappears, definitely has benefits. Potentially, we could attract more maintainers for all the pymeasure projects. Pooling drivers and development effort in one place was one of the motivations for pymeasure for a long time, after all. So, there's arguments for both ways. I don't know what's better. 🤷 |
Ok, let's move the NI driver to its own repo as a pymeasure plugin, developing the plugin system in this way. |
From the three plugin methods, I like the namespace, as it allows to import from pymeasure.plugins without the need to write a search routine for entry points and the need to import all plug-ins instead just the needed plugin file. |
Introduction
Currently, pymeasure is geared towards devices, which exchange serial messages (mostly, but not only, ASCII) without the need for further libraries.
There are, however, devices, which require special manufacturer's libraries like DLLs or via COMs (component object model).
Obstacle
I do not see, how they could profit from the pymeasure instrument core, nor how we could test or maintain them reliably.
Therefore, I do not like the idea to include them in pymeasure itself.
History
Possible solution
One possibility could be opening another repository, which collects such instrument drivers.
These drivers should be in the style of pymeasure (properties) with according doc strings (more we cannot enforce, due to the libraries).
Pros
Cons
Question
What do you think @bilderbuchi , @CasperSchippers , @msmttchr ?
The text was updated successfully, but these errors were encountered: