pioreactor icon indicating copy to clipboard operation
pioreactor copied to clipboard

turn callback helpers in ODReader to decorators

Open CamDavidsonPilon opened this issue 3 years ago • 3 comments

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}!")

CamDavidsonPilon avatar Dec 02 '22 15:12 CamDavidsonPilon

Hello,

Are these issues available for public to contribute?

Thanks

varuntumbe avatar Dec 03 '22 07:12 varuntumbe

Hi @varuntumbe,

Sure! Here are some docs on getting your local development working. (Those docs may need some tweaks, let me know).

I work on the develop branch, so you can push PRs to that branch.

CamDavidsonPilon avatar Dec 03 '22 18:12 CamDavidsonPilon

That's great to hear! I was looking for some challenging open source project to contribute. I will first try to install repo locally and will go forward from there.

Thanks

varuntumbe avatar Dec 04 '22 03:12 varuntumbe