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

Runtime parameters, support all config parameters #387

Merged
merged 3 commits into from
Dec 20, 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
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"]
"extensions": ["ms-python.debugpy", "ms-python.python","charliermarsh.ruff"]
}
},

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)
runtimeparams, params, retrieve_hass_conf, optim_conf, plant_conf, set_type, logger, emhass_conf)
# 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)
runtimeparams, params, retrieve_hass_conf, optim_conf, plant_conf, "forecast", logger, emhass_conf)

# 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"]["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']
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']
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
Loading