Skip to content

add sphinx documentation for readthedocs - #8

Merged
alpae merged 3 commits into
mainfrom
add-docs
Oct 16, 2026
Merged

alpae merged 3 commits into
mainfrom
add-docs

Conversation

@alpae

@alpae alpae commented Oct 16, 2026

Copy link
Copy Markdown
Member

The docs explain why NCBI and GTDB are combined, how to install
omataxonomy, how to build the database (including the choice of GTDB
release and building from a prepared archive) and walk through the
query API in an annotated tutorial. An API reference is generated from
the docstrings, two of which needed a blank line before their field
lists to render.

The examples in background.md and tutorial.md are run as doctests
against the pinned GTDB r232 test database, so they cannot drift from
the actual output.

The docs are built with sphinx, myst-parser and furo from a new "docs"
dependency group, limited to Python >= 3.11 so that the test matrix
down to Python 3.9 is unaffected. .readthedocs.yaml installs that group
with uv.

The docs explain why NCBI and GTDB are combined, how to install
omataxonomy, how to build the database (including the choice of GTDB
release and building from a prepared archive) and walk through the
query API in an annotated tutorial. An API reference is generated from
the docstrings, two of which needed a blank line before their field
lists to render.

The examples in background.md and tutorial.md are run as doctests
against the pinned GTDB r232 test database, so they cannot drift from
the actual output.

The docs are built with sphinx, myst-parser and furo from a new "docs"
dependency group, limited to Python >= 3.11 so that the test matrix
down to Python 3.9 is unaffected. .readthedocs.yaml installs that group
with uv.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Documented workflows fail as written, and several guarantees contradict the implementation.

7 open findings
What changed in this PR

Adds a Sphinx documentation site for omataxonomy, covering its combined taxonomy, database setup, and query API.

Changes:

  • Adds guides, an annotated tutorial, and generated API documentation.
  • Configures Read the Docs and Python ≥3.11 documentation dependencies.
  • Adds documentation doctests and fixes docstring formatting.
File Description
uv.lock Locks documentation dependencies.
tests/​test_doctests.py Tests background and tutorial examples.
pyproject.toml Adds documentation dependencies and project links.
omataxonomy/​query.py Adds blank lines for docstring rendering.
docs/​tutorial.md Demonstrates taxonomy queries and tree annotation.
docs/​installation.md Documents installation and prerequisites.
docs/​index.md Introduces the package and documentation navigation.
docs/​database.md Explains database creation and management.
docs/​conf.py Configures Sphinx, extensions, and theme.
docs/​background.md Explains combining NCBI and GTDB.
docs/​api.md Generates the public API reference.
.readthedocs.yaml Configures hosted documentation builds.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/background.md Resolved
Comment thread docs/database.md Outdated
Comment on lines +19 to +20
1. downloads the current NCBI taxdump (`taxdump.tar.gz`) and checks it
against its md5 checksum,
Comment thread docs/database.md Resolved
Comment thread docs/database.md
Comment on lines +108 to +110
from omataxonomy import build_combined_tarball

build_combined_tarball("omatax-gtdb-r232.tar.gz", gtdb_release=232)
Comment thread docs/database.md
Comment on lines +116 to +117
tax = Taxonomy(dbfile="/data/taxonomy/gtdb-r232/taxonomy.sqlite",
taxdump_file="omatax-gtdb-r232.tar.gz")
Comment thread docs/database.md
column is the code and its second column a taxid or a scientific name:

```python
tax.update_mnemonic_codes(speclist="speclist.txt", extra_file="extra_codes.tsv")
Comment thread docs/tutorial.md Resolved
alpae added 2 commits October 16, 2026 15:15
- build_combined_tarball changes into a temporary directory before
  writing the archive, so a relative target ended up in that directory
  and was deleted with it. update_db failed on a bare archive file name
  because os.makedirs('') raises. Both now resolve their paths first.
- the md5 checksum of the NCBI taxdump was only compared for an already
  existing file, never after downloading it. A mismatch after the
  download now raises an IOError.
- update_mnemonic_codes(speclist=...) passed the value to urlretrieve,
  which rejects plain file paths, so a local speclist.txt was never
  loaded. Existing files are now read directly.
- GTDB taxids are reproducible for a given release, but a taxon can get
  a different taxid in another release if hash collisions change. Say so
  instead of promising stable taxids.
- mention that building from an archive still downloads the UniProt
  mnemonics and how to load them offline.
- tax2track of annotate_tree only covers the taxids already in the tree,
  not the inferred ancestors.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alpae
alpae merged commit 8c638ca into main Oct 16, 2026
21 checks passed
@alpae
alpae deleted the add-docs branch October 16, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants