Miksus / rocketry

Modern scheduling library for Python
https://rocketry.readthedocs.io
MIT License
3.26k stars 105 forks source link

ENH: Better argument support for custom condition #29

Closed Miksus closed 2 years ago

Miksus commented 2 years ago

Describe the solution you'd like At the moment this is not possible:

from redengine.args import Task

@app.cond("is things")
def is_things(task=Task()):
    return True or False

If this was a starting condition of a task, that task should be put as the argument.

Additional context Maybe the task injection to the conditions could be a bit reworked to work uniformly with user-defined conditions. Maybe we could have a check method in the conditions for such purposes instead of relying to __bool__.