Skip to content

Commit

Permalink
address comments and rebase main
Browse files Browse the repository at this point in the history
  • Loading branch information
jieru-hu committed Mar 29, 2022
1 parent fcdb02a commit 83f386a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/experimental/rerun/my_app.py
Expand Up @@ -10,7 +10,7 @@
log = logging.getLogger(__name__)


@hydra.main(config_path=".", config_name="config")
@hydra.main(version_base=None, config_path=".", config_name="config")
def my_app(cfg: DictConfig) -> None:
log.info(f"Output_dir={HydraConfig.get().runtime.output_dir}")
log.info(f"cfg.foo={cfg.foo}")
Expand Down
5 changes: 2 additions & 3 deletions hydra/main.py
Expand Up @@ -24,7 +24,7 @@ def _get_rerun_conf(file_path: str, overrides: List[str]) -> DictConfig:
warnings.warn(msg, UserWarning)
file = Path(file_path)
if not file.exists():
raise ValueError(f"{file} does not exist!")
raise ValueError(f"File {file} does not exist!")

if len(overrides) > 0:
msg = "Config overrides are not supported as of now."
Expand Down Expand Up @@ -82,9 +82,8 @@ def decorated_main(cfg_passthrough: Optional[DictConfig] = None) -> Any:
args = args_parser.parse_args()
if args.experimental_rerun is not None:
cfg = _get_rerun_conf(args.experimental_rerun, args.overrides)
ret = task_function(cfg)
task_function(cfg)
_flush_loggers()
return ret
else:
# no return value from run_hydra() as it may sometime actually run the task_function
# multiple times (--multirun)
Expand Down
1 change: 1 addition & 0 deletions news/1805.feature
@@ -0,0 +1 @@
Add `--experimental-rerun` command-line option

0 comments on commit 83f386a

Please sign in to comment.