Conversation
pyproject.toml
Outdated
| ## Main modules ## | ||
| converters = ["poulet_py[seq]"] | ||
| hardware = ["poulet_py[camera, arduino, julabo, qst, triggers]"] | ||
| hardware = ["poulet_py[camera, arduino, julabo, qst, triggers, sensor]"] |
There was a problem hiding this comment.
sensor has to be defined too under hardware section:
sensor = ["poulet_py[soho]"]
There was a problem hiding this comment.
I've resolved this by updating the hardware extra on line 84 to reference soho instead of sensor. The soho extra was already defined on line 77 with its pandas dependency, but the hardware aggregate was still pointing to the non-existent sensor extra. Now when someone installs poulet_py[hardware], it'll properly include the SOHO sensor dependencies along with the other hardware modules.
poulet_py/hardware/sensor/soho.py
Outdated
| time.sleep(0.1) | ||
|
|
||
| @staticmethod | ||
| def log_error(error_message: str, error_log_file: Optional[str]) -> None: |
There was a problem hiding this comment.
do you need a function for logs? LOGGER can output all logs to a file if defined by env (not sure though if this is working yet, havent fixed the env problem)
There was a problem hiding this comment.
you're right, i'll remove this
poulet_py/hardware/sensor/soho.py
Outdated
| output_path: Optional[str] = None | ||
| error_log_path: Optional[str] = None | ||
|
|
||
| class Soho: |
There was a problem hiding this comment.
this way SohoConfig is not much needed.
my proposal is for the Soho class to inherit from BaseModel and define there the required fields.
for internal private fields use PrivateAttr i.e. _private: int = PrivateAttr(default=1)
this way you ensure the validation and boundaries and all these setters getter can be minimized
There was a problem hiding this comment.
I've refactored the Soho class to inherit from BaseModel directly, eliminating the separate SohoConfig class. The config fields (host, port, output_path, error_log_path) are now defined as Field attributes on Soho itself, and I've converted the private fields (_stop, _active, _collection_thread, _listener_thread) to use PrivateAttr as suggested. This simplifies the API, provides automatic validation through Pydantic, and aligns with the pattern used by other hardware classes like GPIOTrigger. I've also updated all references from self.config.host/self.config.port to self.host/self.port, and removed SohoConfig from the module exports. The class now follows a cleaner, more consistent structure whilst maintaining all existing functionality.
is this what you meant?
…remove unused log_error method from Soho class
…ng class structure. Adjust imports and __all__ definitions accordingly.
…t handling and improve import statements. Adjusted baseline temperature range in TCSStimulus class and refined data handling in Soho class.
… limits (20-45 °C) and adjust corresponding field description.
… docstrings, including usage examples and parameter descriptions for improved clarity and usability.
…ctionality to launch the Ponemah executable. Enhanced import statements and included a new helper function for managing Ponemah connections.
…ation, and add new attributes for error logging, output files, and data handling. Removed redundant attribute initializations from the constructor for cleaner code.
…ocking mechanism for thread safety and implementing an incremental data update method. Refactor data saving logic to ensure proper handling of output file and data state.
This PR introduces Soho, a small client to collect telemetry data from PONEMAH (the software driving our implant telemetry probes for mouse core temperature). I’ve been using this code across projects with Amanda and Gamze; this brings it into poulet_py so we can reuse it consistently. I've done a bit of pydantic.