-
Notifications
You must be signed in to change notification settings - Fork 902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve REE capacity parser time granularity #6218
base: master
Are you sure you want to change the base?
Improve REE capacity parser time granularity #6218
Conversation
"end_date": target_datetime.strftime("%Y-12-31T23:59"), | ||
"time_trunc": "year", | ||
"start_date": target_datetime.strftime("%Y-%m-01T00:00"), | ||
"end_date": target_datetime.strftime("%Y-%m-31T23:59"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems like the code works if running for November but this can lead to errors for months that do not have 31 days.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should do the trick:
calendar.monthrange(test_date.year, test_date.month)[1]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works for me for other months, even February. I could change it to"%Y-%m-01T23:59", if you wish. That one seems to also work. Is it necessary to be the last day of the month?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no i don't think it need to be the last day if the parser returns the same data when you query for 1 day
Description
I have updated the REE capacity parser so it takes into account the month of the given timestamp instead of only the year
This will allow to have more recent and accurate capacities
Preview
Double check
poetry run update_capacity --zone "zone_key"
pnpx prettier --write .
andpoetry run format
to format my changes.