From aec572811d9eb9361377f2ff39965f7bc89c7be1 Mon Sep 17 00:00:00 2001 From: liorr Date: Wed, 25 Sep 2024 10:19:23 +0300 Subject: [PATCH] fix some coding style issues --- optibess_algorithm/output_calculator.py | 6 +++--- optibess_algorithm/producers.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/optibess_algorithm/output_calculator.py b/optibess_algorithm/output_calculator.py index 5e08dbd..2b5c45a 100644 --- a/optibess_algorithm/output_calculator.py +++ b/optibess_algorithm/output_calculator.py @@ -1152,7 +1152,7 @@ def sell_prices(self): return self._sell_prices @sell_prices.setter - def sell_prices(self, value: np.ndarray[Any, float]): + def sell_prices(self, value: np.ndarray[Any, np.dtype[np.float64]]): if isinstance(value, np.ndarray) and is_real_numbers(value): if value.shape != (YEAR_HOURS,) and value.shape != (self._project_hour_num,): raise ValueError(f"Prices shape should be ({YEAR_HOURS},) or ({self._project_hour_num}, ), prices" @@ -1172,7 +1172,7 @@ def buy_prices(self): return self._buy_prices @buy_prices.setter - def buy_prices(self, value: np.ndarray[Any, float]): + def buy_prices(self, value: np.ndarray[Any, np.dtype[np.float64]]): if isinstance(value, np.ndarray) and is_real_numbers(value): if value.shape != (YEAR_HOURS,) and value.shape != (self._project_hour_num, ): raise ValueError(f"Prices shape should be ({YEAR_HOURS},) or ({self._project_hour_num}, ), prices" @@ -1200,7 +1200,7 @@ def tariff_table(self, value: np.ndarray[Any, np.dtype[np.float64]]): raise ValueError("Tariff table should be of shape (7, 12, 24)") self._tariff_table = value - def _get_action_from_obs(self, obs: np.ndarray[Any, float]): + def _get_action_from_obs(self, obs: np.ndarray[Any, np.dtype[np.float64]]): """ get action(s) from model given an observation diff --git a/optibess_algorithm/producers.py b/optibess_algorithm/producers.py index b3a3280..b26b453 100644 --- a/optibess_algorithm/producers.py +++ b/optibess_algorithm/producers.py @@ -369,7 +369,7 @@ def annual_deg(self, value): def start_year(self): return self._start_year - def _set_start_year(self, value: int): + def _set_start_year(self, value): if value is None: self._start_year = datetime.datetime.today().year else: