cli: shared option decorators, one `--device`/`--num-workers`/`--seed` convention, lazy startup
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 24/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- python
- Lĩnh vực
- cli, developer-experience
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- Python
- Star
- 0
- Fork
- 0
- Merge trung bình
- 11 giờ 17 phút
- Pull request đã merge (30 ngày)
- 23
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rnabioco/leech
-
load_model_from_checkpoint drops num_out/signal_in_channels for models whose __init__ takes **kwargsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 Hơn một tuần Mức phù hợp với người mới 18/100
Maintainer thường phản hồi trong vòng 1 ngày
-
model train-many: one launcher that owns an allocation and trains a queue of configs across its GPUsĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 18/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của rnabioco/leech
Issue tương tự
-
docs: powerpc not supportedĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
microsoft/TokenEconomizer#360 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
reasons-gate
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
benthomasson/reasons-service#190 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày