Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wetterdienst #376

Merged
merged 5 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading