Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Initial docs and JupyterBook setup #66

Merged
merged 11 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ instance/

# Sphinx documentation
docs/_build/
docs/generated/

# PyBuilder
.pybuilder/
Expand Down
23 changes: 23 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"
jobs:
install:
- asdf plugin add pixi
- asdf install pixi latest
- asdf global pixi latest
- pixi run -e py-phylo2vec build-docs
- mkdir -p $READTHEDOCS_OUTPUT/html/
- cp -r docs/_build/html/** $READTHEDOCS_OUTPUT/html/

# Optionally build your docs in additional formats such as PDF and ePub
formats: []
39 changes: 39 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Book settings
# Learn more at https://jupyterbook.org/customize/config.html

title: Phylo2Vec
author: Don Setiawan
# logo: logo.png

# Force re-execution of notebooks on each build.
# See https://jupyterbook.org/content/execute.html
execute:
execute_notebooks: force

# Define the name of the latex output file for PDF builds
latex:
latex_documents:
targetname: book.tex

# Information about where the book exists on the web
repository:
url: https://github.com/uw-ssec/phylo2vec # Online location of your book
path_to_book: docs # Optional path to your book, relative to the repository root
branch: master # Which branch of the repository should be used when creating links (optional)

# Add GitHub buttons to your book
# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository
html:
use_issues_button: true
use_repository_button: true


sphinx:
extra_extensions:
- 'sphinx.ext.autodoc'
- 'sphinx.ext.napoleon'
- 'sphinx.ext.viewcode'
- 'sphinx.ext.autosummary'
config:
add_module_names: True
autosummary_generate: True
7 changes: 7 additions & 0 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Table of contents
# Learn more at https://jupyterbook.org/customize/toc.html

format: jb-book
root: intro
chapters:
- file: api.rst
44 changes: 44 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
API Reference
=============

.. currentmodule:: phylo2vec

Base
----------------

.. autosummary::
:nosignatures:
:toctree: generated/

base.to_newick
base.to_vector

Metrics
----------------

.. autosummary::
:nosignatures:
:toctree: generated/

metrics.cophenetic_distances

Utils
----------------

.. autosummary::
:nosignatures:
:toctree: generated/

utils.find_num_leaves
utils.create_label_mapping
utils.apply_label_mapping
utils.remove_annotations
utils.remove_parent_labels
utils.sample
utils.seed_everything
utils.check_v
utils.reorder_v
utils.reroot_at_random
utils.remove_leaf
utils.add_leaf
utils.get_common_ancestor
12 changes: 12 additions & 0 deletions docs/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Welcome to your Jupyter Book

This is a small sample book to give you a feel for how book content is
structured. It shows off a few of the major file types, as well as some sample
content. It does not go in-depth into any particular topic - check out
[the Jupyter Book documentation](https://jupyterbook.org) for more information.

Check out the content pages bundled with this sample book to see more.

```{tableofcontents}

```
1 change: 1 addition & 0 deletions docs/requirements.txt
ayushnag marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jupyter-book
979 changes: 979 additions & 0 deletions pixi.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,14 @@ pip = ">=24.2,<25"
maturin = ">=1.7.4,<2"
jupyterlab = ">=4.1,<4.2"
pytest = ">=8.3.4,<9"
jupyter-book = ">=0.11.0"

[feature.python.tasks.install-python]
cmd = "maturin develop --manifest-path ./py-phylo2vec/Cargo.toml"

[feature.python.tasks.build-docs]
cmd = "jupyter-book build docs"

lsetiawan marked this conversation as resolved.
Show resolved Hide resolved
[feature.python.tasks.test]
cmd = "pytest -vvv ./py-phylo2vec/tests"
depends-on = ["install-python"]
Expand Down
Loading