Skip to content

Commit

Permalink
merge new wetterdienst and main
Browse files Browse the repository at this point in the history
  • Loading branch information
k-rieck committed Dec 18, 2024
2 parents 534b26c + 35fa4b5 commit 764a959
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
10 changes: 4 additions & 6 deletions hisim/components/controller_mpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,17 +709,15 @@ 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)))

p_el = np.reshape(np.array(price_purchase_forecast_24h), (1, len(price_purchase_forecast_24h)))
p_el: np.ndarray = np.reshape(np.array(price_purchase_forecast_24h), (1, len(price_purchase_forecast_24h)))

feed_in_tariff = np.reshape(
feed_in_tariff: np.ndarray = np.reshape(
np.array(price_injection_forecast_24h),
(1, len(price_injection_forecast_24h)),
)
Expand Down
2 changes: 1 addition & 1 deletion hisim/components/generic_car.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions hisim/components/weather_data_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def dwd_10min_request(
ts_interpolation_use_nearby_station_distance=40,
)

parameters = [DwdObservationParameter.MINUTE_10.TEMPERATURE_AIR_MEAN_2M,
parameters = [DwdObservationParameter.MINUTE_10.TEMPERATURE_AIR_MEAN_200,
DwdObservationParameter.MINUTE_10.PRESSURE_AIR_SITE,
DwdObservationParameter.MINUTE_10.WIND_DIRECTION,
DwdObservationParameter.MINUTE_10.WIND_SPEED,
Expand Down Expand Up @@ -240,7 +240,7 @@ def dwd_10min_request(
)
print("Write Weather Data into Dataframe.")
temperature_dwd_df = (
values[values["parameter"] == "temperature_air_mean_2m"]
values[values["parameter"] == "temperature_air_mean_200"]
.groupby("date")["value"]
.apply(lambda x: ", ".join(map(str, x)))
.reset_index()
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ ordered_set
typing_extensions
python-dotenv
windpowerlib # ==0.2.1
wetterdienst
wetterdienst==0.63.0
cdsapi
xarray
xarray

0 comments on commit 764a959

Please sign in to comment.