Pioreactor / Pioreactor/pioreactor

turn callback helpers in ODReader to decorators

Open
#359 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement future good first issue
Dominant language
Python
Stars
149
Forks
18
PR merge metrics
No merged PRs in 30d

Description

Current:
from pioreactor.background_jobs.od_reading import ODReader

# example of using callbacks to OD reading...

def hello(self):
    print(f"Hello, {self}!")


def goodbye(self, readings):
    print(f"Goodbye, {self}, witnessed {readings}!")

ODReader.add_pre_read_callback(hello)
ODReader.add_post_read_callback(goodbye)
Desired:
from pioreactor.background_jobs.od_reading import ODReader

# example of using callbacks to OD reading...

@ODReader.add_pre_read_callback
def hello(self):
    print(f"Hello, {self}!")


@ODReader.add_post_read_callback
def goodbye(self, readings):
    print(f"Goodbye, {self}, witnessed {readings}!")

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in pioreactor.background_jobs.od_reading at the ODReader callback helpers and compare their current behavior with the decorator usage shown in the issue. Done means add_pre_read_callback and add_post_read_callback support the demonstrated decorator form while retaining the callback behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.