-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The fix simplifies the diagram. Details below fuel and electricity consumers will no longer available. It also assumes no changes over time.
- Loading branch information
Showing
12 changed files
with
322 additions
and
560 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from dataclasses import dataclass | ||
from datetime import datetime | ||
from typing import Self | ||
|
||
from libecalc.common.time_utils import Period | ||
|
||
|
||
@dataclass(eq=True, frozen=True) | ||
class ModelChangeEvent: | ||
""" | ||
An event that (might) change the structure of the diagram. Since dates in the model might be used to set | ||
expressions only, the structure might not change even though there is a change event. | ||
""" | ||
|
||
name: str | ||
period: Period | ||
|
||
@property | ||
def start(self) -> datetime: | ||
return self.period.start | ||
|
||
@property | ||
def end(self) -> datetime: | ||
return self.period.end | ||
|
||
@classmethod | ||
def from_period(cls, period) -> Self: | ||
return cls( | ||
name=str(period.start), | ||
period=period, | ||
) |
This file contains 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
Oops, something went wrong.