From de82eb7aebdc9d36ed6ed6ceec6ecd13a16f1a8b Mon Sep 17 00:00:00 2001 From: k-rieck Date: Wed, 18 Dec 2024 10:57:22 +0100 Subject: [PATCH] fix type anotation --- hisim/components/controller_mpc.py | 6 ++---- hisim/components/generic_car.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/hisim/components/controller_mpc.py b/hisim/components/controller_mpc.py index d296943c5..9f17203f5 100644 --- a/hisim/components/controller_mpc.py +++ b/hisim/components/controller_mpc.py @@ -709,10 +709,8 @@ def optimize( # noqa: C901 cop_sampled = cop_timestep[0::sampling_rate] eer_sampled = eer_timestep[0::sampling_rate] - cop_sampled_array = np.reshape(np.array(cop_sampled), (1, len(cop_sampled))) - eer_sampled_array = np.reshape(np.array(eer_sampled), (1, len(eer_sampled))) - cop_sampled_array = np.reshape(np.array(cop_sampled), (1, len(cop_sampled))) - eer_sampled_array = np.reshape(np.array(eer_sampled), (1, len(eer_sampled))) + cop_sampled_array: np.ndarray = np.reshape(np.array(cop_sampled), (1, len(cop_sampled))) + eer_sampled_array: np.ndarray = np.reshape(np.array(eer_sampled), (1, len(eer_sampled))) # Numerical values of pv forecast (casadi fromat) pv_forecast_24h = np.reshape(np.array(pv_forecast_24h), (1, len(pv_forecast_24h))) diff --git a/hisim/components/generic_car.py b/hisim/components/generic_car.py index da3be82e2..ce6ac7478 100644 --- a/hisim/components/generic_car.py +++ b/hisim/components/generic_car.py @@ -574,7 +574,7 @@ def resample_meters_driven(self, meters_driven: List, seconds_per_timestep: int) trimmed_meters_driven = meters_driven[: num_timesteps * minutes_per_timestep] # Reshape and sum the data - reshaped_meters = np.reshape(trimmed_meters_driven, (num_timesteps, minutes_per_timestep)) + reshaped_meters: np.ndarray = np.reshape(trimmed_meters_driven, (num_timesteps, minutes_per_timestep)) resampled_meters = np.sum(reshaped_meters, axis=1) return resampled_meters