diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 012ce4d..be6255f 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -47,13 +47,13 @@ jobs: sudo apt-get -y install pandoc pip install -r docs/requirements.txt - name: Build documentation - run: sphinx-build docs docs/_build/html + run: sphinx-build -b dirhtml docs docs/_build - name: Setup Pages uses: actions/configure-pages@v5 - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: - path: 'docs/_build/html' + path: 'docs/_build' - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 diff --git a/README.md b/README.md index 4aa7342..41acc08 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ # FluffyClone [![GitHub Release](https://img.shields.io/github/v/release/ulysseherbach/fluffyclone?logo=github)](https://github.com/ulysseherbach/fluffyclone) +[![GitHub Pages status](https://img.shields.io/github/actions/workflow/status/ulysseherbach/fluffyclone/github-pages.yml?label=docs)](https://ulysseherbach.github.io/fluffyclone/) diff --git a/docs/README.md b/docs/README.md index c76de92..51ce1d2 100644 --- a/docs/README.md +++ b/docs/README.md @@ -5,23 +5,21 @@ depends on something that is deprecated and removed in `3.12`. ## Install dependencies -From the root of the project you can install the dependencies required for the +From the `docs` folder of the project, you can install the dependencies required for the documentation generation by typing: ```bash -pip install -r docs/requirements.txt +pip install -r requirements.txt ``` -## Build +## Build website pages To build the website run the command: ```bash -sphinx-build docs docs/_build/html +sphinx-build . _build ``` -or go the `docs` folder and run `make html`. - ## Visualize the website -You can open the `docs/_build/html/index.html` file in your browser. +You can open the `_build/index.html` file in your browser. diff --git a/docs/_static/custom.css b/docs/_static/custom.css index 69fd436..48e7250 100644 --- a/docs/_static/custom.css +++ b/docs/_static/custom.css @@ -1,3 +1,4 @@ +/* alabaster theme */ a.reference { border: 0; @@ -15,7 +16,19 @@ h1.logo a:hover { border: 0; } +div.sphinxsidebar h3 { + display: none; +} + +/* pydata_sphinx_theme */ + /*.bd-search { border: 0; border-radius: .5rem; }*/ + +/* sphinx_copybutton */ + +button.copybtn { + font-size: 0.85em; +} diff --git a/docs/clonal_trees.md b/docs/clonal_trees.md new file mode 100644 index 0000000..0bc29dd --- /dev/null +++ b/docs/clonal_trees.md @@ -0,0 +1,26 @@ +# Clonal trees + +:::{warning} +This documentation is still a draft. +::: + +## Define clonal trees + +```python +from fluffyclone import ClonalTree +``` + +### Parent sequence encoding + +```python +# Option 1: pass the parent sequence directly +tree = ClonalTree(0, 0, 0, 2, 5) + +# Option 2: define parent sequence first +p = (0, 0, 0, 2, 5) +tree = ClonalTree(p) + +# Option 3: add root explicitly (node 0 with no parent) +p = (None, 0, 0, 0, 2, 5) +tree = ClonalTree(p) +``` diff --git a/docs/distributions.md b/docs/distributions.md new file mode 100644 index 0000000..971e362 --- /dev/null +++ b/docs/distributions.md @@ -0,0 +1,32 @@ +# Distributions + +:::{warning} +This documentation is still a draft. +::: + +## Definition + +```python +from fluffyclone import WeightedUniform, WeightedUniformGibbs + +# Number of clones +n_clones = 5 + +# General form +model1 = WeightedUniform(n_clones) + +# Gibbs form +model2 = WeightedUniformGibbs(n_clones) + +# Using just-in-time-compilation +model3 = WeightedUniform(n_clones, jit=True) +model4 = WeightedUniformGibbs(n_clones, jit=True) +``` + +## Usage + +```python +# Sampling trees from the model +tree = model1.sample() +tree_list = model1.sample(size=10) +``` diff --git a/docs/index.md b/docs/index.md index 4316bd3..31201d8 100644 --- a/docs/index.md +++ b/docs/index.md @@ -9,6 +9,13 @@ This documentation is still a draft. ::: +## Installation + +```bash +pip install fluffyclone --upgrade +``` + + ## Indexes * [General Index](genindex) @@ -17,6 +24,10 @@ This documentation is still a draft. :::{toctree} :hidden: +:maxdepth: 2 -quickstart/index +quickstart +clonal_trees +distributions +models/index ::: diff --git a/docs/models/index.md b/docs/models/index.md new file mode 100644 index 0000000..30cb8a2 --- /dev/null +++ b/docs/models/index.md @@ -0,0 +1,13 @@ +# Models + +:::{warning} +This documentation is still a draft. +::: + +:::{toctree} +:hidden: +:maxdepth: 2 + +model1 +model2 +::: diff --git a/docs/models/model1.md b/docs/models/model1.md new file mode 100644 index 0000000..2dc0c06 --- /dev/null +++ b/docs/models/model1.md @@ -0,0 +1,5 @@ +# Model 1 + +:::{warning} +This documentation is still a draft. +::: diff --git a/docs/models/model2.md b/docs/models/model2.md new file mode 100644 index 0000000..0da88ff --- /dev/null +++ b/docs/models/model2.md @@ -0,0 +1,5 @@ +# Model 2 + +:::{warning} +This documentation is still a draft. +::: diff --git a/docs/quickstart.md b/docs/quickstart.md new file mode 100644 index 0000000..19af26f --- /dev/null +++ b/docs/quickstart.md @@ -0,0 +1,22 @@ +# Quickstart + +## Define a clonal tree + +```python +from fluffyclone import ClonalTree +``` + +### Parent sequence encoding + +```python +# Option 1: pass the parent sequence directly +tree = ClonalTree(0, 0, 0, 2, 5) + +# Option 2: define parent sequence first +p = (0, 0, 0, 2, 5) +tree = ClonalTree(p) + +# Option 3: add root explicitly (node 0 with no parent) +p = (None, 0, 0, 0, 2, 5) +tree = ClonalTree(p) +``` diff --git a/docs/quickstart/index.md b/docs/quickstart/index.md deleted file mode 100644 index cf5f418..0000000 --- a/docs/quickstart/index.md +++ /dev/null @@ -1,17 +0,0 @@ -# Quickstart - - -```{code-block} python ---- -emphasize-lines: 1, 2 ---- -a = 2 -print('my 1st line') -print(f'my {a}nd line') -``` - -```{code-block} python -a = 2 -print('my 1st line') -print(f'my {a}nd line') -```