cli: shared option decorators, one `--device`/`--num-workers`/`--seed` convention, lazy startup
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 24/100
- Tipo de issue
- Refactorización
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- python
- Área
- cli, developer-experience
Línea de trabajo
Start with the duplicated option blocks in src/leech/cli.py (the train and optimize commands) and the shared helpers in cli_options.py, including LazyChoice. Then check the import chain: leech/__init__.py (the subprocess import) and leech/commands/__init__.py, measured with python -X importtime -c "import leech.cli". Done means the shared decorators are used everywhere, a click-tree test enforces one help string and default per option name, and import time is under 300 ms. The design choices (device default, metric alias, seed) need maintainer input before coding.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Tier P2 · effort M · from the 2026-09-13 review (CLI F4, F5, F10, F11, F17, F18)
src/leech/cli.py is 2,029 lines, 1,185 of them inside @click.option
decorators (204 of them); 146 distinct options appear 259 times and 42 are
declared verbatim on two or more commands. --balance-groups,
--oversample-minority, --adversarial-lambda, --adversarial-anneal-epochs,
--confound, --confound-config, --cl-regression, --cl-lambda,
--signal-mode, --num-workers are pasted inline in both train
(cli.py:721-808) and optimize (:1362-1425); --checkpoint-metric (:810)
and --selection-metric (:1426) are one option under two names; prepare
and predict re-declare eight extraction options with hand-copied help that has
drifted (--cl-regression 788 vs 1410; --backend 227 vs 1921).
--device is Choice[cuda,cpu] default cuda on eight commands, type=str
default cpu on calibrate (:1141-1146), Choice[auto,cuda,cpu] default
auto on train-crf (:530-532). --num-workers means "0 = auto" on four
commands and defaults to 8 on benchmark (:974-979); prepare/predict
call it --workers. --seed is None everywhere except train-crf (0).
--min-margin is a uint8 range on predict and a float on train-crf.
--motif is required=True (cli_options.py:310-315) on train/optimize
although prepare supports --focus-tsv corpora with no motif. Startup:
import leech.cli is 484 ms, of which pkg_version("leech") at decoration
time (cli.py:69) is 137 ms and a top-level import subprocess in
leech/__init__.py:24 is 59 ms; leech.commands.__init__ eagerly imports
eight handlers and numpy (909 ms) against the lazy-import rule
leech/__init__.py:59-61 documents. LazyChoice (cli_options.py:87-91)
skips click.Choice.__init__.
Acceptance criteria
training_extras,confound_options,extraction_optionsanddevice_optiondecorators incli_options.py; no option text is declared twice. A test iterates the click tree and asserts every option name has one help string and one default across commands (documented exceptions listed in the test).--device auto|cuda|cpuwithautoas the default everywhere;--num-workerseverywhere with--workerskept as a hidden alias for one minor; the metric option has one name (the other kept hidden as an alias);--seeddefaultNoneeverywhere (or the CRF exception documented in its help).--motifoptional ontrain/optimize, warned when absent.@click.version_option(package_name="leech");subprocessimported lazily;commands/__init__.pyis PEP 562 lazy;python -X importtime -c "import leech.cli"under 300 ms on this node, recorded in the PR.LazyChoicecallssuper().__init__or resolves names at import (the registry is torch-free).
Non-goals
- The
TrainConfigwork (separate issue; do that first if both are scheduled, since it removes the three 54-name lists).
- Lenguaje dominante
- Python
- Estrellas
- 0
- Forks
- 0
- Merge medio
- 11 h 17 min
- PR fusionados (30 d)
- 23
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de rnabioco/leech
-
load_model_from_checkpoint drops num_out/signal_in_channels for models whose __init__ takes **kwargsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 Más de una semana Aptitud para principiantes 18/100
Los mantenedores suelen responder en 1 día
-
model train-many: one launcher that owns an allocation and trains a queue of configs across its GPUsAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 18/100
Los mantenedores suelen responder en 1 día
Todos los issues de rnabioco/leech
Issues similares
-
docs: powerpc not supportedAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
microsoft/TokenEconomizer#360 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
reasons-gate
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
benthomasson/reasons-service#190 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
ui
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día