Skip to content

Commit

Permalink
Convert - to _ in parse_extras
Browse files Browse the repository at this point in the history
  • Loading branch information
bpkroth committed Aug 19, 2024
1 parent 8afe9c3 commit d53fdbc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions mlos_bench/mlos_bench/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,10 @@ def _try_parse_extra_args(cmdline: Iterable[str]) -> Dict[str, TunableValue]:
# Handles missing trailing elem from last --key arg.
raise ValueError("Command line argument has no value: " + key)

# Convert "max-suggestions" to "max_suggestions" for compatibility with
# other CLI options to use as common python/json variable replacements.
config = {k.replace("-", "_"): v for k, v in config.items()}

_LOG.debug("Parsed config: %s", config)
return config

Expand Down
2 changes: 1 addition & 1 deletion mlos_bench/mlos_bench/tests/launcher_in_process_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"mlos_bench/mlos_bench/tests/config/cli/mock-opt.jsonc",
"--trial_config_repeat_count",
"3",
"--max_suggestions",
"--max-suggestions",
"3",
"--mock_env_seed",
"42", # Noisy Mock Environment.
Expand Down

0 comments on commit d53fdbc

Please sign in to comment.