Skip to content

Commit

Permalink
solution output file names now given as a string on command line
Browse files Browse the repository at this point in the history
  • Loading branch information
DLWoodruff committed Aug 15, 2024
1 parent f9287a1 commit 744fe5f
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions mpisppy/agnostic/agnostic_cylinders.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ def _parse_args(m):
domain=str,
default=None,
argparse=True)
cfg.add_to_config(name="write_solution",
description="send write solution output to a csv, an npv file and a directory with names based on the module",
domain=bool,
default=False)
cfg.add_to_config(name="solution_base_name",
description="The string used fo a directory of ouput along with a csv and an npv file (default None, which means no soltion output)",
domain=str,
default=None)
cfg.popular_args()
cfg.two_sided_args()
cfg.ph_args()
Expand Down Expand Up @@ -142,10 +142,9 @@ def _parse_args(m):
wheel = WheelSpinner(hub_dict, list_of_spoke_dict)
wheel.spin()

write_solution = cfg.write_solution
if write_solution:
wheel.write_first_stage_solution(f'{model_fname}.csv')
wheel.write_first_stage_solution(f'{model_fname}.npy',
if cfg.solution_base_name is not None:
wheel.write_first_stage_solution(f'{cfg.solution_base_name}.csv')
wheel.write_first_stage_solution(f'{cfg.solution_base_name}.npy',
first_stage_solution_writer=sputils.first_stage_nonant_npy_serializer)
wheel.write_tree_solution(f'{model_fname}_solution')
wheel.write_tree_solution(f'{cfg.solution_base_name}')

0 comments on commit 744fe5f

Please sign in to comment.