Skip to content
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

exluced normalize from national #339

Merged
merged 15 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/pydantic_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@ class NationalForecastValue(ForecastValue):
None, description="Dictionary to hold properties of the forecast, like p_levels. "
)

expected_power_generation_normalized: Optional[float] = Field(
None,
ge=0,
description="exclude the normalized power",
exclude=True,
)

@validator("expected_power_generation_megawatts")
def result_check(cls, v):
"""Round to 2 decimal places"""
Expand Down
1 change: 1 addition & 0 deletions src/tests/test_national.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def test_read_latest_national_values(db_session, api_client):
national_forecast_values[24].plevels["plevel_10"]
!= national_forecast_values[0].expected_power_generation_megawatts * 0.9
)
assert "expected_power_generation_normalized" not in national_forecast_values[0].model_dump()


def test_read_latest_national_values_creation_limit(db_session, api_client):
Expand Down
Loading