Skip to content

Commit

Permalink
🐛 Avoid error when new maturity is added
Browse files Browse the repository at this point in the history
Upgrade somenergia-ui to 0.5.1
  • Loading branch information
MariteSomEnergia committed Jan 13, 2025
1 parent 1edff58 commit 382c436
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change log

## Unreleased
- Avoid errors when a new maturity is added
- Ungrade somenergia-ui to 0.5.1 that fixes curve labels

## 1.2.0 (2024-11-13)
- Add HD maturity

Expand Down
2 changes: 1 addition & 1 deletion backend/datasources/dummy.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def dummy_production_data(
nhours = round(
(last_timestamp_utc - first_timestamp_utc) / datetime.timedelta(hours=1)
)
maturity_options = ["H2", "H3", "HP", "HC", None]
maturity_options = ["H2", "H3", "HP", "HC", "HD", None]

return CustomerProductionData(
data=[
Expand Down
10 changes: 1 addition & 9 deletions backend/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,22 +165,14 @@ class ProductionData(BaseModel):
data: str
value: int

DataMaturity = Literal[
'H2',
'H3',
'HP',
'HC',
'HD',
]

class ContractProductionData(BaseModel):
contract_name: str
first_timestamp_utc: AwareDatetime
last_timestamp_utc: AwareDatetime
foreseen_kwh: list[float | None]
measure_kwh: list[float | None]
estimated: list [bool | None]
maturity: list[DataMaturity | None]
maturity: list[str | None]

class CustomerProductionData(BaseModel):
data: list[ContractProductionData]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@mui/material": "^5.14.6",
"@mui/x-date-pickers": "^6.19.3",
"@prettier/plugin-xml": "^3.2.2",
"@somenergia/somenergia-ui": "^0.3.0",
"@somenergia/somenergia-ui": "^0.5.1",
"axios": "^1.5.1",
"dayjs": "^1.11.10",
"i18next": "^23.4.5",
Expand Down

0 comments on commit 382c436

Please sign in to comment.