Synergy H1 backend - #757
Conversation
Modified: __init__.py backend biotek_tests.py Added: agilent_biotek_backend.py agilent_biotek_cytation_backend.py agilent_biotek_synergyh1_backend.py Removed: biotek_backend.py (ruff reformatted the rest)
|
Here is my proposal for a Modified the following files:
Added the following files:
Deleted the following files:
This proposal may not be perfect at first, as I rearranged the code and added some abstract properties in the I tested the |
There was a problem hiding this comment.
Pull request overview
This PR introduces support for the Agilent BioTek Synergy H1 plate reader by refactoring the existing Cytation5Backend into a more modular architecture. The refactoring extracts common BioTek plate reader functionality into a new base class BioTekPlateReaderBackend, renames Cytation5Backend to CytationBackend (with backward-compatible deprecation wrappers), and adds the new SynergyH1Backend that inherits from the base class with H1-specific customizations.
Key changes:
- Created
BioTekPlateReaderBackendbase class containing shared functionality for all BioTek plate readers (FTDI communication, plate management, absorbance/luminescence/fluorescence reading) - Renamed
Cytation5BackendtoCytationBackendwith deprecation warnings for backward compatibility - Added
SynergyH1Backendwith H1-specific features (heating support, custom focal height range, improved read buffer handling with FtdiError retry logic)
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
agilent_biotek_backend.py |
New base class containing shared BioTek plate reader functionality (594 lines of refactored code from Cytation backend) |
agilent_biotek_cytation_backend.py |
Refactored Cytation backend to inherit from base class, removing duplicate code and adding deprecation wrappers for old class names |
agilent_biotek_synergyh1_backend.py |
New backend for Synergy H1 readers with custom _read_until implementation for chunk-based reading and FtdiError handling |
__init__.py |
Updated exports to include new backends and base class, but missing backward-compatible exports |
biotek_tests.py |
Updated test import to use new CytationBackend name |
molecular_devices_backend.py, imager.py, clario_star_backend.py, chatterbox.py |
Minor code formatting improvements (spacing around operators) |
Comments suppressed due to low confidence (4)
pylabrobot/plate_reading/agilent_biotek_cytation_backend.py:148
- The
stop()method is callingsuper().stop()first, but then also callsself.stop_shaking()andself.io.stop(), which are already called in the parent class'sstop()method (lines 590-592 ofagilent_biotek_backend.py). This results in duplicate calls to these methods. Consider removing the duplicate calls here to avoid potential issues:
async def stop(self):
await super().stop()
if self._acquiring:
self.stop_acquisition()
self._stop_camera()
self._objectives = None
self._filters = None
# _slow_mode is already reset in parent class
self._exposure = None
# ... rest of the resetspylabrobot/plate_reading/agilent_biotek_cytation_backend.py:139
- The
setup()method duplicates all the code from the parent class'ssetup()method instead of callingsuper().setup(). This creates maintainability issues and violates DRY (Don't Repeat Yourself). Consider refactoring to:
async def setup(self, use_cam: bool = False) -> None:
await super().setup()
if use_cam:
try:
await self._set_up_camera()
except:
await self.stop()
raisepylabrobot/plate_reading/agilent_biotek_cytation_backend.py:944
- Trailing space in the deprecation warning message
pylabrobot/plate_reading/agilent_biotek_cytation_backend.py:953 - Trailing space in the deprecation warning message
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
0853cc0 to
86f367e
Compare
|
thank you so much! |
|
Of course! And thank you for the review : ) When I'm back in the lab, I'll double check the SynergyH1 Backend and add in the documentation |
Here is the working backend for the Synergy H1 readers. A work in progress as I was able to verify absorbance reading so far : )