cli: shared option decorators, one `--device`/`--num-workers`/`--seed` convention, lazy startup
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 24/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- python
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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).
- 主要言語
- Python
- スター
- 0
- フォーク
- 0
- 平均マージ
- 11時間 17分
- マージ済み PR(30日)
- 23
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rnabioco/leech のほかの issue
-
load_model_from_checkpoint drops num_out/signal_in_channels for models whose __init__ takes **kwargsオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 1週間以上 初心者へのやさしさ 18/100
メンテナーはふだん 1 日以内に返信
-
model train-many: one launcher that owns an allocation and trains a queue of configs across its GPUsオープン
難易度 5/5 1週間以上 初心者へのやさしさ 18/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
microsoft/TokenEconomizer#360 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
reasons-gate
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
benthomasson/reasons-service#190 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
ui
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信