Acquire every resource kind through one interface instead of per-kind branches

未关闭
#161 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
活跃
技术栈
python

调研方向

Start by reading downloads.py, data_resources.py, download_cli.py and install.py, then compare the per-kind helpers named in the issue with the linked issues #152–#164. Map how current kinds implement listing, inspection, acquisition and info before proposing the shared interface. Done means a new kind needs only a registered implementation, data commands and setup have no per-kind branches, and existing CLI/Python behavior is preserved.

由索引模型根据 Issue 内容生成。

描述

enhancement

Adding a resource kind today means editing at least five places:

  • downloads.py: six hand-written finders that build DataStatus rows.
  • data_resources.py: branches per kind in _resolve, data_info and fetch_data.
  • download_cli.py: a focused subcommand per kind.
  • install.py: separate loops for catalogues, chains and collections.
  • The kind's own command group.

These modules reach into each other's private helpers (viral_panel._bundle_path/_existing_bundle, liftover._chain_registry, genomes._registry, catalog._BUNDLED/_installed/_plan). The duplication is why the paths have drifted: the repair policy, timeouts, status words and option grammar each differ by kind and command (see the linked issues). This is the per-source sidecar shape that ORFdata otherwise avoids.

Proposal: one small resource interface per kind, covering:

  • rows(): identity, species, version, sizes and terms;
  • inspect(name, version, verify): a shared status;
  • acquire(name, version, force, sources, options): download or build;
  • info(name, version).

list, status, info, path, fetch and setup then become generic loops over a registry of kinds.

Acceptance: a new kind is one registered implementation. The data commands and setup contain no per-kind branches. Existing CLI and Python behavior is preserved, with the fixes from the linked issues.

Related: the repair policy (#152), status words (#164), option grammar (#163) and command consolidation (#162) are the visible symptoms.

主要语言
Python
星标
1
派生
1
平均合并
10 小时 11 分钟
30 天内合并 PR
51

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

openvax/orfdata 的其他 Issue

查看 openvax/orfdata 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。