labscript-suite-temp / labscript_devices

Module containing labscript suite hardware compatibility, separate from the main programs. Device compatibility is implemented with a plugin architecture, for modularity and extensibility. Each file in this module contains a labscript device class, a BLACS tab class, a BLACS worker class and a runviewer parser class for a particular device. These implement functionality for the device which the programs in question call on when they encounter each device in user labscript code, hdf5 files, or connection tables.
0 stars 0 forks source link

One folder per device, one file for each program's class #6

Open philipstarkey opened 10 years ago

philipstarkey commented 10 years ago

Original report (archived issue) by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


In the spirit of only executing the code you need, and not putting fairly unrelated types of code together, I propose splitting labscript_devices further. Each LabscriptDeviceClassName.py in there should become LabscriptDeviceClassName/__init__.py and the BLACS tab and runviewer parsers should each be put in their own files too, named something like BLACS_tab and runviewer_parser or something. These filenames would be required in order for the classes to be found by BLACS and runviewer.

The interfaces to getting these classes would not change under this proposal, and so it would be backward compatible with the programs that use them.

It would still be:

from labscript_devices.LabscriptDeviceClassName import LabscriptDeviceClassName

for labscript, and still

labscript_devices.get_BLACS_tab and labscript_devices.get_runviewer_parser

for BLACS and runviewer

philipstarkey commented 10 years ago

Original comment by Philip Starkey (Bitbucket: pstarkey, GitHub: pstarkey).


I agree. Lincoln has also agreed this sounds fine the two times I have mentioned it to him!