labthings / labthings/labthings-fastapi
Add a `side_effect` option to data properties.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 9
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
Is your feature request related to a problem? Please describe.
Data properties are a lot shorter and cleaner to write than functional properties when a property is simple. However, if I need something to happen when the property is set (forwarding it to hardware, re-generating cached data, etc) then a functional property is needed.
Describe the solution you'd like
A side_effect argument that can accept a callable.
frame_rate: float = lt.property(default=25, side_effect=self.update_camera_properties)
I am not sure however, if it is possible to use self here? As it is within a class but not within a classes function where self is defined?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files, tests, or entry points. First determine where data properties are implemented and how functional properties receive their instance context. Done means defining the callable-based side_effect behavior, resolving the self-binding question, and adding coverage for the requested usage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100