Skip to content

Commit

Permalink
Merge branch 'Impelon-patch-4' into sil-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin-steinke committed Jul 31, 2024
2 parents 248d391 + 25f0478 commit c691abd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vessim/sil.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def __init__(self, data_pipe_out: Connection, events_pipe_in: Connection):
self._state_ts: list[tuple[DatetimeLike, dict]] = []
self._p_delta_ts: list[tuple[DatetimeLike, float]] = []
self._e_delta_ts: list[tuple[DatetimeLike, float]] = []
self._time: Optional[DatetimeLike] = None
self._microgrid: Optional[Microgrid] = None
self._state: dict[str, dict] = {}
self._p_delta: float = 0
Expand All @@ -44,6 +45,7 @@ def __init__(self, data_pipe_out: Connection, events_pipe_in: Connection):
def _recv_data(self) -> None:
while True:
time, data = self._data_pipe_out.recv()
self._time = time
self._microgrid = data["microgrid"]
self._state = data["state"]
self._p_delta = data["p_delta"]
Expand All @@ -65,6 +67,10 @@ def set_event(self, category: str, value: Any) -> None:
}
)

@property
def time(self) -> DatetimeLike | None:
return self._time

@property
def microgrid(self) -> Microgrid | None:
return self._microgrid
Expand Down

0 comments on commit c691abd

Please sign in to comment.