Skip to content

Commit

Permalink
Merge pull request #638 from bouthilx/hotfix/diff_warning
Browse files Browse the repository at this point in the history
Warn only if diffs exists during exp build
  • Loading branch information
bouthilx authored Aug 23, 2021
2 parents 76656ea + feb541a commit 40a0659
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/orion/core/io/experiment_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def build(name, version=None, branching=None, **config):

if must_branch and branching.get("enable", orion.core.config.evc.enable):
return _attempt_branching(conflicts, experiment, version, branching)
else:
elif must_branch:
log.warning(
"Running experiment in a different state:\n%s",
_get_branching_status_string(conflicts, branching),
Expand Down
10 changes: 8 additions & 2 deletions tests/unittests/core/io/test_experiment_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,9 @@ def test_build_from_args_without_cmd(old_config_file, script_path, new_config):
assert exp.algorithms.configuration == new_config["algorithms"]


@pytest.mark.usefixtures("with_user_tsirif", "version_XYZ")
@pytest.mark.usefixtures(
"with_user_tsirif", "version_XYZ", "mock_infer_versioning_metadata"
)
class TestExperimentVersioning(object):
"""Create new Experiment with auto-versioning."""

Expand All @@ -572,7 +574,11 @@ def test_experiment_overwritten_evc_disabled(self, parent_version_config, caplog
parent_version_config.pop("version")
with OrionState(experiments=[parent_version_config]):

exp = experiment_builder.load(name=parent_version_config["name"])
with caplog.at_level(logging.WARNING):

exp = experiment_builder.build(name=parent_version_config["name"])
assert "Running experiment in a different state" not in caplog.text

assert exp.version == 1
assert exp.configuration["algorithms"] == {"random": {"seed": None}}

Expand Down

0 comments on commit 40a0659

Please sign in to comment.