Skip to content

Commit

Permalink
write a copy of the stimela config to logdir/stimela.recipe.config.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
landmanbester committed Sep 4, 2024
1 parent 68fb9c3 commit 7cc9a98
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions stimela/commands/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def load_recipe_files(filenames: List[str]):
@click.option("--dump-config", is_flag=True,
help="""Dump the equivalent stimela config to a file""")
@click.argument("parameters", nargs=-1, metavar="filename.yml ... [recipe or cab name] [PARAM=VALUE] ...", required=True)
def run(parameters: List[str] = [], dry_run: bool = False, last_recipe: bool = False, profile: Optional[int] = None,
def run(parameters: List[str] = [], dump_config: bool = False, dry_run: bool = False, last_recipe: bool = False, profile: Optional[int] = None,
assign: List[Tuple[str, str]] = [],
config_equals: List[str] = [],
config_assign: List[Tuple[str, str]] = [],
Expand Down Expand Up @@ -448,8 +448,9 @@ def log_available_runnables():
log.debug(line)

if dump_config:
import ipdb; ipdb.set_trace()
OmegaConf.save(stimela.config, f="test.yaml")
filename = os.path.join(logdir, "stimela.recipe.config.yaml")
log.info(f"recipe config will be saved under {filename}")
OmegaConf.save(stimela.CONFIG, f=filename)

if dry_run:
log.info("dry run was requested, exiting")
Expand Down

0 comments on commit 7cc9a98

Please sign in to comment.