Fold --to/--gen dataset-versioning flags into the dwarf CLI
origin/energy-conservation-poc grew bump-gen/bump-schema --to and update-manifest --gen flags (091b23a) plus a train output-dir date prefix (305e436) after the dwarf unification was written locally. Reconcile: bring plan_bump_gen/plan_bump_schema/plan_update_manifest's target/target_gen support into the plain-function (argparse-free) form, thread --to/--gen through scripts/dwarf.py's bump-gen/bump-schema/ update-manifest commands, and take giant/cli.py's date-prefix change and the associated tests as-is. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+33
-4
@@ -175,11 +175,19 @@ def bump_gen(
|
||||
date: Annotated[
|
||||
Optional[str], typer.Option("--date", help="Override date (default: today, ISO)")
|
||||
] = None,
|
||||
to: Annotated[
|
||||
Optional[str],
|
||||
typer.Option(
|
||||
"--to", metavar="genN", help="Target gen tag (default: one past the current highest)"
|
||||
),
|
||||
] = None,
|
||||
execute: Annotated[bool, typer.Option("--execute", help="Apply (default: dry run)")] = False,
|
||||
root: Annotated[Path, typer.Option("--root", help="Dataset root")] = _DATASET_ROOT_DEFAULT,
|
||||
) -> None:
|
||||
"""Cut a new raw generation."""
|
||||
run_bump_gen(kind=kind, reason=reason, by=by, date=date, execute=execute, root=str(root))
|
||||
run_bump_gen(
|
||||
kind=kind, reason=reason, by=by, date=date, execute=execute, root=str(root), to=to
|
||||
)
|
||||
|
||||
|
||||
@app.command("bump-schema")
|
||||
@@ -193,12 +201,27 @@ def bump_schema(
|
||||
date: Annotated[
|
||||
Optional[str], typer.Option("--date", help="Override date (default: today, ISO)")
|
||||
] = None,
|
||||
to: Annotated[
|
||||
Optional[str],
|
||||
typer.Option(
|
||||
"--to",
|
||||
metavar="schemaN",
|
||||
help="Target schema tag (default: one past the current highest)",
|
||||
),
|
||||
] = None,
|
||||
execute: Annotated[bool, typer.Option("--execute", help="Apply (default: dry run)")] = False,
|
||||
root: Annotated[Path, typer.Option("--root", help="Dataset root")] = _DATASET_ROOT_DEFAULT,
|
||||
) -> None:
|
||||
"""Cut a new schema within a gen."""
|
||||
run_bump_schema(
|
||||
kind=kind, gen=gen, reason=reason, by=by, date=date, execute=execute, root=str(root)
|
||||
kind=kind,
|
||||
gen=gen,
|
||||
reason=reason,
|
||||
by=by,
|
||||
date=date,
|
||||
execute=execute,
|
||||
root=str(root),
|
||||
to=to,
|
||||
)
|
||||
|
||||
|
||||
@@ -223,12 +246,18 @@ def update_manifest(
|
||||
help="Target schema tag (default: highest schema found in the same gen dir)",
|
||||
),
|
||||
] = None,
|
||||
gen: Annotated[
|
||||
Optional[str],
|
||||
typer.Option("--gen", metavar="genN", help="Target gen tag (default: keep existing gen)"),
|
||||
] = None,
|
||||
execute: Annotated[
|
||||
bool, typer.Option("--execute", help="Write updated manifests (default: dry run)")
|
||||
] = False,
|
||||
) -> None:
|
||||
"""Repoint manifest(s) to a new schema, verifying all target files exist."""
|
||||
run_update_manifest([str(m) for m in manifests], schema=schema, execute=execute)
|
||||
"""Repoint manifest(s) to a new gen and/or schema, verifying all target files exist."""
|
||||
run_update_manifest(
|
||||
[str(m) for m in manifests], schema=schema, execute=execute, gen=gen
|
||||
)
|
||||
|
||||
|
||||
@app.command("create-manifest")
|
||||
|
||||
Reference in New Issue
Block a user