Skip to content

Commit

Permalink
fix provided arguments check
Browse files Browse the repository at this point in the history
  • Loading branch information
danrgll committed Mar 18, 2024
1 parent 17fe070 commit 9f8e967
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions neps/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ def run(
del searcher_kwargs["budget"]
logger = logging.getLogger("neps")


# if arguments via run_args provided overwrite them
if run_args:
logger.info(
Expand Down
9 changes: 5 additions & 4 deletions neps/utils/run_args_from_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def get_run_args_from_yaml(path):

# Flatten yaml file and ignore hierarchical structure, only consider parameters(keys)
# with a value

flat_config, special_configs = extract_leaf_keys(config)

# Check if just neps arguments are provided
Expand Down Expand Up @@ -280,8 +279,8 @@ def check_run_args(settings):


def check_essential_arguments(
run_pipeline, root_directory, pipeline_space, max_cost_total, max_evaluation_total
):
run_pipeline, root_directory, pipeline_space, max_cost_total, max_evaluation_total,
searcher):
"""
Verifies that essential NEPS arguments are provided.
Expand All @@ -306,9 +305,11 @@ def check_essential_arguments(
if not root_directory:
raise ValueError("'root_directory' is required but was not provided.")
if not pipeline_space:
raise ValueError("'pipeline_space' is required but was not provided.")
if searcher is not Callable:
raise ValueError("'pipeline_space' is required but was not provided.")
if not max_evaluation_total and not max_cost_total:
raise ValueError(
"'max_evaluation_total' or 'max_cost_total' is required but "
"both were not provided."
)

0 comments on commit 9f8e967

Please sign in to comment.