From e11a4c6a2418dc6066e29937f6273c2b0da675d6 Mon Sep 17 00:00:00 2001 From: Paul O'Leary McCann Date: Mon, 27 Feb 2023 16:44:20 +0900 Subject: [PATCH] Revert argument name change --- spacy/cli/assemble.py | 4 ++-- spacy/cli/debug_config.py | 4 ++-- spacy/cli/debug_data.py | 4 ++-- spacy/cli/evaluate.py | 4 ++-- spacy/cli/pretrain.py | 4 ++-- spacy/cli/train.py | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/spacy/cli/assemble.py b/spacy/cli/assemble.py index 9c8971510..7afe36c82 100644 --- a/spacy/cli/assemble.py +++ b/spacy/cli/assemble.py @@ -19,7 +19,7 @@ def assemble_cli( ctx: typer.Context, # This is only used to read additional arguments config_path: Path = Arg(..., help="Path to config file", exists=True, allow_dash=True), output_path: Path = Arg(..., help="Output directory to store assembled pipeline in"), - code_paths: str = Opt("", "--code", "-c", help="Comma-separated paths to Python files with additional code (registered functions) to be included in the package"), + code_path: str = Opt("", "--code", "-c", help="Comma-separated paths to Python files with additional code (registered functions) to be included in the package"), verbose: bool = Opt(False, "--verbose", "-V", "-VV", help="Display more information for debugging purposes"), # fmt: on ): @@ -38,7 +38,7 @@ def assemble_cli( if not config_path or (str(config_path) != "-" and not config_path.exists()): msg.fail("Config file not found", config_path, exits=1) overrides = parse_config_overrides(ctx.args) - import_code_paths(code_paths) + import_code_paths(code_path) with show_validation_error(config_path): config = util.load_config(config_path, overrides=overrides, interpolate=False) msg.divider("Initializing pipeline") diff --git a/spacy/cli/debug_config.py b/spacy/cli/debug_config.py index c63d95d66..170dfc5e0 100644 --- a/spacy/cli/debug_config.py +++ b/spacy/cli/debug_config.py @@ -20,7 +20,7 @@ def debug_config_cli( # fmt: off ctx: typer.Context, # This is only used to read additional arguments config_path: Path = Arg(..., help="Path to config file", exists=True, allow_dash=True), - code_paths: str = Opt("", "--code", "-c", help="Comma-separated paths to Python files with additional code (registered functions) to be included in the package"), + code_path: str = Opt("", "--code", "-c", help="Comma-separated paths to Python files with additional code (registered functions) to be included in the package"), show_funcs: bool = Opt(False, "--show-functions", "-F", help="Show an overview of all registered functions used in the config and where they come from (modules, files etc.)"), show_vars: bool = Opt(False, "--show-variables", "-V", help="Show an overview of all variables referenced in the config and their values. This will also reflect variables overwritten on the CLI.") # fmt: on @@ -37,7 +37,7 @@ def debug_config_cli( DOCS: https://spacy.io/api/cli#debug-config """ overrides = parse_config_overrides(ctx.args) - import_code_paths(code_paths) + import_code_paths(code_path) debug_config( config_path, overrides=overrides, show_funcs=show_funcs, show_vars=show_vars ) diff --git a/spacy/cli/debug_data.py b/spacy/cli/debug_data.py index 77d529aa8..7c7221272 100644 --- a/spacy/cli/debug_data.py +++ b/spacy/cli/debug_data.py @@ -52,7 +52,7 @@ def debug_data_cli( # fmt: off ctx: typer.Context, # This is only used to read additional arguments config_path: Path = Arg(..., help="Path to config file", exists=True, allow_dash=True), - code_paths: str = Opt("", "--code", "-c", help="Comma-separated paths to Python files with additional code (registered functions) to be included in the package"), + code_path: str = Opt("", "--code", "-c", help="Comma-separated paths to Python files with additional code (registered functions) to be included in the package"), ignore_warnings: bool = Opt(False, "--ignore-warnings", "-IW", help="Ignore warnings, only show stats and errors"), verbose: bool = Opt(False, "--verbose", "-V", help="Print additional information and explanations"), no_format: bool = Opt(False, "--no-format", "-NF", help="Don't pretty-print the results"), @@ -72,7 +72,7 @@ def debug_data_cli( "--help for an overview of the other available debugging commands." ) overrides = parse_config_overrides(ctx.args) - import_code_paths(code_paths) + import_code_paths(code_path) debug_data( config_path, config_overrides=overrides, diff --git a/spacy/cli/evaluate.py b/spacy/cli/evaluate.py index 9eb51e1f8..f5fdb185c 100644 --- a/spacy/cli/evaluate.py +++ b/spacy/cli/evaluate.py @@ -22,7 +22,7 @@ def evaluate_cli( model: str = Arg(..., help="Model name or path"), data_path: Path = Arg(..., help="Location of binary evaluation data in .spacy format", exists=True), output: Optional[Path] = Opt(None, "--output", "-o", help="Output JSON file for metrics", dir_okay=False), - code_paths: str = Opt("", "--code", "-c", help="Comma-separated paths to Python files with additional code (registered functions) to be included in the package"), + code_path: str = Opt("", "--code", "-c", help="Comma-separated paths to Python files with additional code (registered functions) to be included in the package"), use_gpu: int = Opt(-1, "--gpu-id", "-g", help="GPU ID or -1 for CPU"), gold_preproc: bool = Opt(False, "--gold-preproc", "-G", help="Use gold preprocessing"), displacy_path: Optional[Path] = Opt(None, "--displacy-path", "-dp", help="Directory to output rendered parses as HTML", exists=True, file_okay=False), @@ -41,7 +41,7 @@ def evaluate_cli( DOCS: https://spacy.io/api/cli#benchmark-accuracy """ - import_code_paths(code_paths) + import_code_paths(code_path) evaluate( model, data_path, diff --git a/spacy/cli/pretrain.py b/spacy/cli/pretrain.py index b80f95355..409a30bc0 100644 --- a/spacy/cli/pretrain.py +++ b/spacy/cli/pretrain.py @@ -19,7 +19,7 @@ def pretrain_cli( ctx: typer.Context, # This is only used to read additional arguments config_path: Path = Arg(..., help="Path to config file", exists=True, dir_okay=False, allow_dash=True), output_dir: Path = Arg(..., help="Directory to write weights to on each epoch"), - code_paths: str = Opt("", "--code", "-c", help="Comma-separated paths to Python files with additional code (registered functions) to be included in the package"), + code_path: str = Opt("", "--code", "-c", help="Comma-separated paths to Python files with additional code (registered functions) to be included in the package"), resume_path: Optional[Path] = Opt(None, "--resume-path", "-r", help="Path to pretrained weights from which to resume pretraining"), epoch_resume: Optional[int] = Opt(None, "--epoch-resume", "-er", help="The epoch to resume counting from when using --resume-path. Prevents unintended overwriting of existing weight files."), use_gpu: int = Opt(-1, "--gpu-id", "-g", help="GPU ID or -1 for CPU"), @@ -47,7 +47,7 @@ def pretrain_cli( DOCS: https://spacy.io/api/cli#pretrain """ config_overrides = parse_config_overrides(ctx.args) - import_code_paths(code_paths) + import_code_paths(code_path) verify_cli_args(config_path, output_dir, resume_path, epoch_resume) setup_gpu(use_gpu) msg.info(f"Loading config from: {config_path}") diff --git a/spacy/cli/train.py b/spacy/cli/train.py index e259458ac..0b6da0a4f 100644 --- a/spacy/cli/train.py +++ b/spacy/cli/train.py @@ -20,7 +20,7 @@ def train_cli( ctx: typer.Context, # This is only used to read additional arguments config_path: Path = Arg(..., help="Path to config file", exists=True, allow_dash=True), output_path: Optional[Path] = Opt(None, "--output", "--output-path", "-o", help="Output directory to store trained pipeline in"), - code_paths: str = Opt("", "--code", "-c", help="Comma-separated paths to Python files with additional code (registered functions) to be included in the package"), + code_path: str = Opt("", "--code", "-c", help="Comma-separated paths to Python files with additional code (registered functions) to be included in the package"), verbose: bool = Opt(False, "--verbose", "-V", "-VV", help="Display more information for debugging purposes"), use_gpu: int = Opt(-1, "--gpu-id", "-g", help="GPU ID or -1 for CPU") # fmt: on @@ -41,7 +41,7 @@ def train_cli( """ util.logger.setLevel(logging.DEBUG if verbose else logging.INFO) overrides = parse_config_overrides(ctx.args) - import_code_paths(code_paths) + import_code_paths(code_path) train(config_path, output_path, use_gpu=use_gpu, overrides=overrides)