NatLabRockies / NatLabRockies/H2Integrate
Yaml formatting with date-time values
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 26
- Forks
- 44
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 16
Description
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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate load_yaml() and trace the loader used for the peak_range example; inspect the referenced peak-load PRs for the intended handling. Add focused coverage showing that HH:MM:SS values are preserved as strings, then verify both start and end behavior against the issue's examples.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100