Skip to content

Commit

Permalink
#469: update remaining files
Browse files Browse the repository at this point in the history
  • Loading branch information
cwschilly committed Oct 18, 2023
1 parent ce9e896 commit 0ceda3f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
16 changes: 10 additions & 6 deletions config/update-config-script.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,18 @@ def __update_conf(self, config: dict):

if "output_dir" in config:
output_dir = config["output_dir"]
else:
output_dir = "../output"

if "output_file_stem" in config:
if "output_file_stem" in config:
file_stem = config["output_file_stem"]
else:
file_stem = "output_file"

if "LBAF_Viz" in config:
config["visualization"] = config.pop("LBAF_Viz")
config["visualization"]["output_visualization_dir"] = output_dir
config["visualization"]["output_visualization_file_stem"] = file_stem
if "LBAF_Viz" in config:
config["visualization"] = config.pop("LBAF_Viz")
config["visualization"]["output_visualization_dir"] = output_dir
config["visualization"]["output_visualization_file_stem"] = file_stem

return config

Expand Down Expand Up @@ -123,7 +127,7 @@ def run(self, filepath: str):
self.__logger.info(f"Updating {filename}")

new_config = self.__update_conf(config)
# self.__validate_configuration(new_config)
self.__validate_configuration(new_config)
self.__write_config(new_config, output_dir, filename)

if __name__ == "__main__":
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/config/conf_correct_from_data_min_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ algorithm:

# Specify output
output_file_stem: output_file
LBAF_Viz:
visualization:
x_ranks: 2
y_ranks: 2
z_ranks: 1
object_jitter: 0.5
rank_qoi: work
object_qoi: work
force_continuous_object_qoi: true
output_visualization_dir: ../output
output_visualization_file_stem: output_file
4 changes: 3 additions & 1 deletion tests/unit/config/conf_wrong_algorithm_invalid_001.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ algorithm:

# Specify output
output_file_stem: output_file
LBAF_Viz:
visualization:
x_ranks: 2
y_ranks: 2
z_ranks: 1
object_jitter: 0.5
rank_qoi: work
object_qoi: work
force_continuous_object_qoi: true
output_visualization_dir: ../output
output_visualization_file_stem: output_file

0 comments on commit 0ceda3f

Please sign in to comment.