This came up in some peak-load management PRs (and was noted by @vijay092). In these PRs, there are two required control parameters that are supposed to be in date-time format as HH:MM:SS
peak_range:
start: 12:00:00
end: 20:00:00
When these are loaded with load_yaml(), the values are converted to seconds from midnight. Aka
config = load_yaml(filepath)
config["peak_range"]["start"] # this value is an integer of 43200
config["peak_range"]["end"] # this value is an integer of 72000
I think that two options to handle this are:
- allow string formatting in the pre-commit for yaml files when values have
:. This means that the yaml files would be able to look like:
peak_range:
start: "12:00:00"
end: "20:00:00"
OR
- add something into
load_yaml() that prevents this conversion. So that the yaml file values formatted as HH:MM:SS are loaded as strings. This stack overflow post may have some options for this
@jaredthomas68 - how did you handle this in your peak-load PR?
This came up in some peak-load management PRs (and was noted by @vijay092). In these PRs, there are two required control parameters that are supposed to be in date-time format as HH:MM:SS
When these are loaded with
load_yaml(), the values are converted to seconds from midnight. AkaI think that two options to handle this are:
:. This means that the yaml files would be able to look like:OR
load_yaml()that prevents this conversion. So that the yaml file values formatted as HH:MM:SS are loaded as strings. This stack overflow post may have some options for this@jaredthomas68 - how did you handle this in your peak-load PR?