Skip to content

Commit

Permalink
Merge pull request #4 from ulysseherbach/update-docs
Browse files Browse the repository at this point in the history
Update docs
  • Loading branch information
ulysseherbach authored Oct 10, 2024
2 parents 61d228c + 6cf9293 commit 4c82659
Show file tree
Hide file tree
Showing 12 changed files with 136 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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/)
12 changes: 5 additions & 7 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
13 changes: 13 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* alabaster theme */

a.reference {
border: 0;
Expand All @@ -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;
}
26 changes: 26 additions & 0 deletions docs/clonal_trees.md
Original file line number Diff line number Diff line change
@@ -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)
```
32 changes: 32 additions & 0 deletions docs/distributions.md
Original file line number Diff line number Diff line change
@@ -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)
```
13 changes: 12 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ This documentation is still a draft.
:::


## Installation

```bash
pip install fluffyclone --upgrade
```


## Indexes

* [General Index](genindex)
Expand All @@ -17,6 +24,10 @@ This documentation is still a draft.

:::{toctree}
:hidden:
:maxdepth: 2

quickstart/index
quickstart
clonal_trees
distributions
models/index
:::
13 changes: 13 additions & 0 deletions docs/models/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Models

:::{warning}
This documentation is still a draft.
:::

:::{toctree}
:hidden:
:maxdepth: 2

model1
model2
:::
5 changes: 5 additions & 0 deletions docs/models/model1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Model 1

:::{warning}
This documentation is still a draft.
:::
5 changes: 5 additions & 0 deletions docs/models/model2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Model 2

:::{warning}
This documentation is still a draft.
:::
22 changes: 22 additions & 0 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
@@ -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)
```
17 changes: 0 additions & 17 deletions docs/quickstart/index.md

This file was deleted.

0 comments on commit 4c82659

Please sign in to comment.