diff --git a/vessim/__init__.py b/vessim/__init__.py index cb1d548c..a0313feb 100644 --- a/vessim/__init__.py +++ b/vessim/__init__.py @@ -53,7 +53,13 @@ def __init__( forecast: Optional[Union[pd.Series, pd.DataFrame]] = None, ): actual.sort_index() - self._actual = actual.to_frame() if isinstance(actual, pd.Series) else actual + if isinstance(actual, pd.Series): + self._actual = actual.to_frame() + elif isinstance(actual, pd.DataFrame): + self._actual = actual + else: + raise ValueError(f"Incompatible type {type(actual)} for 'actual'.") + if isinstance(forecast, (pd.Series, pd.DataFrame)): forecast.sort_index() if isinstance(forecast, pd.Series): diff --git a/vessim/cosim/consumer.py b/vessim/cosim/consumer.py index 7adfc21e..ab893267 100644 --- a/vessim/cosim/consumer.py +++ b/vessim/cosim/consumer.py @@ -1,3 +1,5 @@ +from typing import Dict + from vessim.core.consumer import Consumer from vessim.cosim._util import VessimSimulator, VessimModel @@ -39,7 +41,7 @@ class _ComputingSystemModel(VessimModel): def __init__(self, consumer: Consumer): self.consumer = consumer self.p = 0.0 - self.info = None + self.info: Dict = {} def step(self, time: int, inputs: dict) -> None: """Updates the power consumption of the system.