Note
Go to the end to download the full example code.
List-schedule, without available data.#
Using an explicit schedule without data, showing number of hours in each partition.
from rics import configure_stuff
from time_split import log_split_progress, plot, split
configure_stuff(datefmt="")
config = dict(
schedule=["2022-01-03", "2022-01-07", "2022-01-10", "2022-01-14"],
after=1,
)
plot(**config)

[rics:WARNING] If you're seeing this in bad places, remove the call to rics.configure_stuff() in:
File "/home/docs/checkouts/readthedocs.org/user_builds/time-split/checkouts/stable/examples/list_schedule_no_data.py", line 10, in <module>
configure_stuff(datefmt="")
<Axes: title={'center': 'time_split.split(schedule=list)'}, ylabel='Fold'>
Note that the last timestamp (‘2022-01-14’) of the schedule was not included; this is because it was used as the
end date (since after=1) of the second-to-last timestamp (‘2022-01-10’), which expands the Future data until
the next scheduled time.
for fold in log_split_progress(split(**config), logger="my-logger"):
print("Doing work..")
[my-logger:INFO] Begin fold 1/3: '2021-12-27' <= [schedule: '2022-01-03' (Monday)] < '2022-01-07'.
Doing work..
[my-logger:INFO] Finished fold 1/3: [schedule: '2022-01-03' (Monday)] after 17 μs.
[my-logger:INFO] Begin fold 2/3: '2021-12-31' <= [schedule: '2022-01-07' (Friday)] < '2022-01-10'.
Doing work..
[my-logger:INFO] Finished fold 2/3: [schedule: '2022-01-07' (Friday)] after 16 μs.
[my-logger:INFO] Begin fold 3/3: '2022-01-03' <= [schedule: '2022-01-10' (Monday)] < '2022-01-14'.
Doing work..
[my-logger:INFO] Finished fold 3/3: [schedule: '2022-01-10' (Monday)] after 15 μs.
Total running time of the script: (0 minutes 0.182 seconds)