feat: Update plant state resolution logic using BOA data#26
Draft
daconjurer wants to merge 3 commits intomainfrom
Draft
feat: Update plant state resolution logic using BOA data#26daconjurer wants to merge 3 commits intomainfrom
daconjurer wants to merge 3 commits intomainfrom
Conversation
…chore: remove current generation value in plant status card until the data can be provided
…consider 'standby' state in plant board
jordan-dimov
approved these changes
Nov 26, 2025
| last_boa_volume: Decimal | None, | ||
| ) -> BalancingDirection | None: | ||
| if state == PlantState.BALANCING: | ||
| if last_boa_volume > 0: |
Member
There was a problem hiding this comment.
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: |
Member
There was a problem hiding this comment.
Don't call the variable datetime - shadows the modules. Pick a better name.
|
|
||
|
|
||
| def get_start_and_end_of_settlement_period( | ||
| datetime: datetime, |
| # TODO: Implement me | ||
| bid_accepted_status = PlantBidAcceptedStatus( | ||
| offer_price=Decimal(100.5), | ||
| start_time=datetime.now(tz=UTC), |
Member
There was a problem hiding this comment.
nitpick: Django's timezone.now() is already timezone-aware, so you can avoid the import of UTC.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.