Miksus / rocketry

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

ENH: Add AT to hourly, daily, weekly etc. #81

Closed Miksus closed 2 years ago

Miksus commented 2 years ago

This PR adds .at(span) to the cond API's time-related conditions:

from rocketry.conds import daily

@app.task(daily.at("11:00"))
def do_things():
    ...

Note that the above is same as daily.between("11:00", "12:00") as the definition is that at is a span of one subunit of the time period. weekly.at("Monday") is not proper English but It's the responsibility of the user to learn English.

codecov-commenter commented 2 years ago

Codecov Report

Merging #81 (c72d8d2) into master (8fa4aea) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master      #81   +/-   ##
=======================================
  Coverage   91.13%   91.14%           
=======================================
  Files          88       88           
  Lines        4366     4368    +2     
=======================================
+ Hits         3979     3981    +2     
  Misses        387      387           
Impacted Files Coverage Δ
rocketry/conditions/api.py 96.92% <100.00%> (+0.04%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.