Skip to content

Commit

Permalink
Merge pull request #395 from davidusb-geek/revert-387-runtime_clean
Browse files Browse the repository at this point in the history
Revert "Runtime parameters, support all config parameters"
  • Loading branch information
davidusb-geek authored Dec 20, 2024
2 parents 12142ec + c5aebe2 commit 0da5440
Show file tree
Hide file tree
Showing 5 changed files with 186 additions and 258 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
// Configure properties specific to VS Code.
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
"extensions": ["ms-python.debugpy", "ms-python.python","charliermarsh.ruff"]
"extensions": ["ms-python.debugpy", "ms-python.python"]
}
},

Expand Down
10 changes: 5 additions & 5 deletions src/emhass/command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def set_input_data_dict(emhass_conf: dict, costfun: str,

# Treat runtimeparams
params, retrieve_hass_conf, optim_conf, plant_conf = utils.treat_runtimeparams(
runtimeparams, params, retrieve_hass_conf, optim_conf, plant_conf, set_type, logger, emhass_conf)
runtimeparams, params, retrieve_hass_conf, optim_conf, plant_conf, set_type, logger)
# Define main objects
rh = RetrieveHass(retrieve_hass_conf['hass_url'], retrieve_hass_conf['long_lived_token'],
retrieve_hass_conf['optimization_time_step'], retrieve_hass_conf['time_zone'],
Expand Down Expand Up @@ -295,7 +295,7 @@ def weather_forecast_cache(emhass_conf: dict, params: str,

# Treat runtimeparams
params, retrieve_hass_conf, optim_conf, plant_conf = utils.treat_runtimeparams(
runtimeparams, params, retrieve_hass_conf, optim_conf, plant_conf, "forecast", logger, emhass_conf)
runtimeparams, params, retrieve_hass_conf, optim_conf, plant_conf, "forecast", logger)

# Make sure weather_forecast_cache is true
if (params != None) and (params != "null"):
Expand Down Expand Up @@ -464,9 +464,9 @@ def naive_mpc_optim(input_data_dict: dict, logger: logging.Logger,
prediction_horizon = input_data_dict["params"]["passed_data"]["prediction_horizon"]
soc_init = input_data_dict["params"]["passed_data"]["soc_init"]
soc_final = input_data_dict["params"]["passed_data"]["soc_final"]
def_total_hours = input_data_dict["params"]["optim_conf"]['operating_hours_of_each_deferrable_load']
def_start_timestep = input_data_dict["params"]["optim_conf"]['start_timesteps_of_each_deferrable_load']
def_end_timestep = input_data_dict["params"]["optim_conf"]['end_timesteps_of_each_deferrable_load']
def_total_hours = input_data_dict["params"]["passed_data"]['operating_hours_of_each_deferrable_load']
def_start_timestep = input_data_dict["params"]["passed_data"]['start_timesteps_of_each_deferrable_load']
def_end_timestep = input_data_dict["params"]["passed_data"]['end_timesteps_of_each_deferrable_load']
opt_res_naive_mpc = input_data_dict["opt"].perform_naive_mpc_optim(
df_input_data_dayahead, input_data_dict["P_PV_forecast"], input_data_dict["P_load_forecast"],
prediction_horizon, soc_init, soc_final, def_total_hours,
Expand Down
Loading

0 comments on commit 0da5440

Please sign in to comment.