Skip to content

Commit

Permalink
Merge branch 'main' into agnostic
Browse files Browse the repository at this point in the history
  • Loading branch information
DLWoodruff authored Jan 6, 2025
2 parents 9f3163b + bc334eb commit 541c4e3
Showing 1 changed file with 7 additions and 2 deletions.
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)

0 comments on commit 541c4e3

Please sign in to comment.