just_dna_enricher.cli.module_commands¶
just_dna_enricher.cli.module_commands ¶
Whole-module commands: enrich-and-compile and upload (RM260 split this out of the former
single-file cli.py).
enrich_and_compile ¶
enrich_and_compile(
spec_dir: Path = typer.Argument(
...,
exists=True,
file_okay=False,
help="Module spec directory",
),
output_dir: Path = typer.Argument(
...,
file_okay=False,
help="Output dir for parquet + manifest.json",
),
strict: bool = typer.Option(
False,
"--strict/--best-effort",
help="Fail unless every variant resolves.",
),
offline: bool = typer.Option(
False,
"--offline",
help="Cache-only: never touch the network.",
),
ensembl_cache: Path | None = typer.Option(
None,
"--ensembl-cache",
help="Explicit Ensembl cache dir/.duckdb.",
),
clinvar_cache: Path | None = typer.Option(
None,
"--clinvar-cache",
help="Explicit ClinVar snapshot dir.",
),
use_clinvar: bool = typer.Option(
True,
"--clinvar/--no-clinvar",
help="Use the ClinVar link (after the Ensembl cache).",
),
use_gnomad: bool = typer.Option(
True,
"--gnomad/--no-gnomad",
help="Use the gnomAD link (last, after live Ensembl).",
),
frequencies: bool = typer.Option(
False,
"--frequencies",
help="Also run the frequency pass (writes frequencies.csv).",
),
gene_metrics: bool = typer.Option(
False,
"--gene-metrics",
help="Also run the gene-constraint pass (writes gene_metrics.csv).",
),
) -> None
Enrich, then compile from the produced resolution.csv (offline, deterministic). Exit 1 on failure.
Source code in enricher/src/just_dna_enricher/cli/module_commands.py
upload_ ¶
upload_(
module_dir: Path = typer.Argument(
...,
exists=True,
file_okay=False,
help="Compiled module directory (at least one annotation parquet + manifest.json).",
),
repo_id: str | None = typer.Option(
None,
"--repo",
help=f"Target HF dataset (owner/name). Default: {DEFAULT_REPO_ID}.",
),
name: str | None = typer.Option(
None,
"--name",
help="Module name under data/<name>/ (and data/<name>/v<version>/) in the repo. Default: the directory basename.",
),
commit_message: str | None = typer.Option(
None,
"--message",
"-m",
help="Commit message. Default: 'Add <name> module'.",
),
dry_run: bool = typer.Option(
False,
"--dry-run",
help="Show what would be uploaded, after every check the upload runs — the versioned path's collision check reads the published manifest (read-only). Writes nothing.",
),
force: bool = typer.Option(
False,
"--force",
help="Overwrite data/<name>/v<version>/ even when it already holds a different artifact, different declared files (logs, provenance, logo, readme) or a different manifest. Without this the publish refuses; the flat path is always overwritten.",
),
) -> None
Upload a compiled module to a HuggingFace dataset collection (publisher/dev surface).
Writes data/
Sends what manifest.json declares: the artifact files, the logo, the readme, provenance.json and every log, as the bytes the plan hashed; a file that changed since is refused. Refuses when the versioned path already holds a different manifest (compared by artifact.digest, each declared sha256 and every other field), unless --force. The flat path means latest and is overwritten either way.
Source code in enricher/src/just_dna_enricher/cli/module_commands.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | |