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

Repair stoch distr #475

Merged
merged 2 commits into from
Dec 29, 2024
Merged
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
9 changes: 7 additions & 2 deletions examples/stoch_distr/stoch_distr_admm_cylinders.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

write_solution = False


def _parse_args():
# create a config object and parse
cfg = config.Config()
Expand All @@ -40,6 +41,10 @@ def _parse_args():
description="Run with async projective hedging instead of progressive hedging",
domain=bool,
default=False)
cfg.add_to_config("json_file_path",
description="JSON file with the data paramaters (default ../distr/data_params.json)",
domain=str,
default="../distr/data_params.json")

cfg.parse_command_line("stoch_distr_admm_cylinders")
return cfg
Expand Down Expand Up @@ -163,7 +168,7 @@ def main(cfg):

if cfg.scalable:
import json
json_file_path = "../distr/data_params.json"
json_file_path = cfg.json_file_path

# Read the JSON file
with open(json_file_path, 'r') as file:
Expand Down Expand Up @@ -206,4 +211,4 @@ def main(cfg):

if __name__ == "__main__":
cfg = _parse_args()
main(cfg)
main(cfg)
Loading