Skip to content

Commit

Permalink
log entry to config file bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Lilferrit committed Dec 2, 2024
1 parent 17bb3f2 commit 903c2bd
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions casanovo/casanovo.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,21 +337,43 @@ def version() -> None:


@main.command()
@click.option(
"-d",
"--output_dir",
help="The destination directory for log and config file.",
type=click.Path(dir_okay=True),
required=False,
)
@click.option(
"-o",
"--output",
help="The output configuration file.",
default="casanovo.yaml",
"--output_root",
help="The root name for log and config file.",
type=click.Path(dir_okay=False),
required=False,
)
@click.option(
"-f",
"--force_overwrite",
help="Whether to overwrite output files.",
is_flag=True,
show_default=True,
default=False,
)
def configure(output: Path) -> None:
def configure(
output_dir: str, output_root: str, force_overwrite: bool
) -> None:
"""Generate a Casanovo configuration file to customize.
The casanovo configuration file is in the YAML format.
"""
Config.copy_default(str(output))
setup_logging(output, "info")
logger.info(f"Wrote {output}\n")
output_path, _ = _setup_output(
output_dir, output_root, force_overwrite, "info"
)
config_fname = output_root if output_root is not None else "config"
config_fname += ".yaml"
config_path = str(output_path / config_fname)
Config.copy_default(config_path)
logger.info(f"Wrote {config_path}\n")


def setup_logging(
Expand Down

0 comments on commit 903c2bd

Please sign in to comment.