Skip to content

Conversation

@daconjurer
Copy link
Collaborator

@daconjurer daconjurer commented Sep 22, 2025

Changes in this MR introduce the actual logic for the PlantStatusSolver class 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.

@daconjurer daconjurer self-assigned this Sep 22, 2025
…chore: remove current generation value in plant status card until the data can be provided
last_boa_volume: Decimal | None,
) -> BalancingDirection | None:
if state == PlantState.BALANCING:
if last_boa_volume > 0:
Copy link
Member

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:
Copy link
Member

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,
Copy link
Member

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),
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants