-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Update plant state resolution logic using BOA data #26
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
base: main
Are you sure you want to change the base?
Conversation
…chore: remove current generation value in plant status card until the data can be provided
…consider 'standby' state in plant board
| last_boa_volume: Decimal | None, | ||
| ) -> BalancingDirection | None: | ||
| if state == PlantState.BALANCING: | ||
| if last_boa_volume > 0: |
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.
If last_boa_volume is None (as per the type annotation) you'd get a TypeError here.
| from datetime import datetime | ||
|
|
||
|
|
||
| def get_settlement_period(datetime: datetime) -> int: |
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.
Don't call the variable datetime - shadows the modules. Pick a better name.
|
|
||
|
|
||
| def get_start_and_end_of_settlement_period( | ||
| datetime: datetime, |
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.
ditto
| # TODO: Implement me | ||
| bid_accepted_status = PlantBidAcceptedStatus( | ||
| offer_price=Decimal(100.5), | ||
| start_time=datetime.now(tz=UTC), |
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.
nitpick: Django's timezone.now() is already timezone-aware, so you can avoid the import of UTC.
Changes in this MR introduce the actual logic for the
PlantStatusSolverclass now that the BOA data is available.The properties for the plant status card and the state part of it are separated too, which results in some small changes in the template.
The template also has changes as the default rendering resolved to cards with the "Standby" state trying to show balancing info. This was fixed.
Finally some formatting / linting and small util functions additions result in the rest of the changes.