Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
birnbaum committed Oct 13, 2023
1 parent e795085 commit 9915663
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 7 additions & 1 deletion vessim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 3 additions & 1 deletion vessim/cosim/consumer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import Dict

from vessim.core.consumer import Consumer
from vessim.cosim._util import VessimSimulator, VessimModel

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 9915663

Please sign in to comment.