Skip to content

Commit 8c44a1b

Browse files
author
Sebastian Birk
committed
Update docs and readthedocs
1 parent 08bf000 commit 8c44a1b

15 files changed

Lines changed: 3443 additions & 191 deletions

File tree

.readthedocs.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ version: 2
33
build:
44
os: ubuntu-20.04
55
tools:
6-
python: "3.10"
6+
python: "3.11"
77
sphinx:
88
configuration: docs/conf.py
99
# disable this for more lenient docs builds
10-
fail_on_warning: true
10+
fail_on_warning: false
1111
python:
1212
install:
13+
- requirements: docs/requirements.txt
1314
- method: pip
1415
path: .
1516
extra_requirements:
16-
- doc
17+
- docsbuild
18+
submodules:
19+
include: [docs/tutorials/notebooks]
20+
recursive: true

docs/api.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

docs/api/developer.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Developer

docs/api/index.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# API
2+
3+
Import MintFlow as:
4+
5+
```
6+
import mintflow
7+
```
8+
9+
```{toctree}
10+
:maxdepth: 2
11+
12+
user
13+
developer
14+
```

docs/api/user.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# User

docs/changelog.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/contributing.md

Lines changed: 2 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -1,142 +1,9 @@
1-
# Contributing guide
1+
# Contributing
22

3-
Scanpy provides extensive [developer documentation][scanpy developer guide], most of which applies to this project, too.
4-
This document will not reproduce the entire content from there. Instead, it aims at summarizing the most important
5-
information to get you started on contributing.
6-
7-
We assume that you are already familiar with git and with making pull requests on GitHub. If not, please refer
8-
to the [scanpy developer guide][].
9-
10-
## Installing dev dependencies
11-
12-
In addition to the packages needed to _use_ this package, you need additional python packages to _run tests_ and _build
13-
the documentation_. It's easy to install them using `pip`:
14-
15-
```bash
16-
cd inflow
17-
pip install -e ".[dev,test,doc]"
18-
```
19-
20-
## Code-style
21-
22-
This package uses [pre-commit][] to enforce consistent code-styles.
23-
On every commit, pre-commit checks will either automatically fix issues with the code, or raise an error message.
24-
25-
To enable pre-commit locally, simply run
26-
27-
```bash
28-
pre-commit install
29-
```
30-
31-
in the root of the repository. Pre-commit will automatically download all dependencies when it is run for the first time.
32-
33-
Alternatively, you can rely on the [pre-commit.ci][] service enabled on GitHub. If you didn't run `pre-commit` before
34-
pushing changes to GitHub it will automatically commit fixes to your pull request, or show an error message.
35-
36-
If pre-commit.ci added a commit on a branch you still have been working on locally, simply use
37-
38-
```bash
39-
git pull --rebase
40-
```
41-
42-
to integrate the changes into yours.
43-
While the [pre-commit.ci][] is useful, we strongly encourage installing and running pre-commit locally first to understand its usage.
44-
45-
Finally, most editors have an _autoformat on save_ feature. Consider enabling this option for [ruff][ruff-editors]
46-
and [prettier][prettier-editors].
47-
48-
[ruff-editors]: https://docs.astral.sh/ruff/integrations/
49-
[prettier-editors]: https://prettier.io/docs/en/editors.html
50-
51-
## Writing tests
52-
53-
```{note}
54-
Remember to first install the package with `pip install -e '.[dev,test]'`
55-
```
56-
57-
This package uses the [pytest][] for automated testing. Please [write tests][scanpy-test-docs] for every function added
58-
to the package.
59-
60-
Most IDEs integrate with pytest and provide a GUI to run tests. Alternatively, you can run all tests from the
61-
command line by executing
62-
63-
```bash
64-
pytest
65-
```
66-
67-
in the root of the repository.
68-
69-
### Continuous integration
70-
71-
Continuous integration will automatically run the tests on all pull requests and test
72-
against the minimum and maximum supported Python version.
73-
74-
Additionally, there's a CI job that tests against pre-releases of all dependencies
75-
(if there are any). The purpose of this check is to detect incompatibilities
76-
of new package versions early on and gives you time to fix the issue or reach
77-
out to the developers of the dependency before the package is released to a wider audience.
78-
79-
[scanpy-test-docs]: https://scanpy.readthedocs.io/en/latest/dev/testing.html#writing-tests
80-
81-
## Publishing a release
82-
83-
### Updating the version number
84-
85-
Before making a release, you need to update the version number in the `pyproject.toml` file. Please adhere to [Semantic Versioning][semver], in brief
86-
87-
> Given a version number MAJOR.MINOR.PATCH, increment the:
88-
>
89-
> 1. MAJOR version when you make incompatible API changes,
90-
> 2. MINOR version when you add functionality in a backwards compatible manner, and
91-
> 3. PATCH version when you make backwards compatible bug fixes.
92-
>
93-
> Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.
94-
95-
Once you are done, commit and push your changes and navigate to the "Releases" page of this project on GitHub.
96-
Specify `vX.X.X` as a tag name and create a release. For more information, see [managing GitHub releases][]. This will automatically create a git tag and trigger a Github workflow that creates a release on PyPI.
97-
98-
## Writing documentation
99-
100-
Please write documentation for new or changed features and use-cases. This project uses [sphinx][] with the following features:
101-
102-
- the [myst][] extension allows to write documentation in markdown/Markedly Structured Text
103-
- [Numpy-style docstrings][numpydoc] (through the [napoloen][numpydoc-napoleon] extension).
104-
- Jupyter notebooks as tutorials through [myst-nb][] (See [Tutorials with myst-nb](#tutorials-with-myst-nb-and-jupyter-notebooks))
105-
- [Sphinx autodoc typehints][], to automatically reference annotated input and output types
106-
- Citations (like {cite:p}`Virshup_2023`) can be included with [sphinxcontrib-bibtex](https://sphinxcontrib-bibtex.readthedocs.io/)
107-
108-
See the [scanpy developer docs](https://scanpy.readthedocs.io/en/latest/dev/documentation.html) for more information
109-
on how to write documentation.
110-
111-
### Tutorials with myst-nb and jupyter notebooks
112-
113-
The documentation is set-up to render jupyter notebooks stored in the `docs/notebooks` directory using [myst-nb][].
114-
Currently, only notebooks in `.ipynb` format are supported that will be included with both their input and output cells.
115-
It is your responsibility to update and re-run the notebook whenever necessary.
116-
117-
If you are interested in automatically running notebooks as part of the continuous integration, please check
118-
out [this feature request](https://github.com/scverse/cookiecutter-scverse/issues/40) in the `cookiecutter-scverse`
119-
repository.
120-
121-
#### Hints
122-
123-
- If you refer to objects from other packages, please add an entry to `intersphinx_mapping` in `docs/conf.py`. Only
124-
if you do so can sphinx automatically create a link to the external documentation.
125-
- If building the documentation fails because of a missing link that is outside your control, you can add an entry to
126-
the `nitpick_ignore` list in `docs/conf.py`
127-
128-
#### Building the docs locally
129-
130-
```bash
131-
cd docs
132-
make html
133-
open _build/html/index.html
134-
```
3+
This will be added shortly.
1354

1365
<!-- Links -->
1376

138-
[scanpy developer guide]: https://scanpy.readthedocs.io/en/latest/dev/index.html
139-
[cookiecutter-scverse-instance]: https://cookiecutter-scverse-instance.readthedocs.io/en/latest/template_usage.html
1407
[github quickstart guide]: https://docs.github.com/en/get-started/quickstart/create-a-repo?tool=webui
1418
[codecov]: https://about.codecov.io/sign-up/
1429
[codecov docs]: https://docs.codecov.com/docs
@@ -147,8 +14,6 @@ open _build/html/index.html
14714
[myst-nb]: https://myst-nb.readthedocs.io/en/latest/
14815
[jupytext]: https://jupytext.readthedocs.io/en/latest/
14916
[pre-commit]: https://pre-commit.com/
150-
[anndata]: https://github.com/scverse/anndata
151-
[mudata]: https://github.com/scverse/mudata
15217
[pytest]: https://docs.pytest.org/
15318
[semver]: https://semver.org/
15419
[sphinx]: https://www.sphinx-doc.org/en/master/
@@ -157,4 +22,3 @@ open _build/html/index.html
15722
[numpydoc]: https://numpydoc.readthedocs.io/en/latest/format.html
15823
[sphinx autodoc typehints]: https://github.com/tox-dev/sphinx-autodoc-typehints
15924
[pypi]: https://pypi.org/
160-
[managing GitHub releases]: https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository

docs/index.md

Lines changed: 57 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,65 @@
1-
```{include} ../README.md
1+
# Documentation
22

3-
```
3+
MintFlow (**M**icroenvironment-induced and **IN**trinsic **T**ranscriptomic **FLOW**s) is a package for decomposing intrinsic and microenvironment-induced cellular variation in spatial transcriptomics data. MintFlow is interoperable with [AnnData](https://anndata.readthedocs.io/en/latest/) objects.
4+
The package is developed and maintained by the [Lotfollahi Lab](https://github.com/Lotfollahi-lab) at the Wellcome Sanger Institute.
5+
6+
::::{grid} 1 2 3 3
7+
:gutter: 2
8+
9+
:::{grid-item-card} Installation {octicon}`plug;1em;`
10+
:link: installation
11+
:link-type: doc
12+
13+
Check out the installation guide.
14+
:::
15+
16+
:::{grid-item-card} Tutorials {octicon}`play;1em;`
17+
:link: tutorials/index
18+
:link-type: doc
19+
20+
Learn by following example applications of MintFlow.
21+
:::
22+
23+
:::{grid-item-card} User Guide {octicon}`book;1em;`
24+
:link: user_guide/index
25+
:link-type: doc
26+
27+
Review good practices for training MintFlow models on your own data.
28+
:::
29+
30+
:::{grid-item-card} API {octicon}`info;1em;`
31+
:link: api/index
32+
:link-type: doc
33+
34+
Find a detailed description of MintFlow APIs.
35+
:::
36+
37+
:::{grid-item-card} Release Notes {octicon}`tag;1em;`
38+
:link: release_notes/index
39+
:link-type: doc
40+
41+
Follow the latest changes to MintFlow.
42+
:::
43+
44+
:::{grid-item-card} Contributing {octicon}`code;1em;`
45+
:link: contributing
46+
:link-type: doc
47+
48+
Help improve Inigen.
49+
:::
50+
::::
51+
52+
If you find Inigen useful for your research, please consider citing the Inigen manuscript.
453

554
```{toctree}
655
:hidden: true
7-
:maxdepth: 1
56+
:maxdepth: 3
57+
:titlesonly: true
858
9-
api.md
10-
changelog.md
59+
installation
60+
tutorials/index
61+
api/index
62+
release_notes/index
1163
contributing.md
1264
references.md
13-
14-
notebooks/example
1565
```

docs/installation.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Installation
2+
3+
MintFlow is available for Python 3.10 and 3.11.
4+
5+
We do not recommend installation on your system Python. Please set up a virtual
6+
environment, e.g. via venv or conda through the [Mambaforge] distribution, or
7+
create a [Docker] image.
8+
9+
To set up and activate a virtual environment with venv, run:
10+
11+
```
12+
python3 -m venv ~/.venvs/mintflow
13+
source ~/.venvs/mintflow/bin/activate
14+
```
15+
16+
To create and activate a conda environment instead, run:
17+
18+
```
19+
conda create -n mintflow python=3.11
20+
conda activate mintflow
21+
```
22+
23+
## Step 1: Installation via PyPi
24+
25+
Install MintFlow via pip:
26+
```
27+
pip install mintflow
28+
```
29+
30+
Or install including optional dependencies required for running tutorials with:
31+
```
32+
pip install mintflow[all]
33+
```
34+
35+
## Step 2: Additional Libraries
36+
37+
To use MintFlow, you need to install some additional external libraries. These include:
38+
- [PyTorch Scatter]
39+
- [PyTorch Sparse]
40+
41+
To install these libraries, after installing MintFlow run:
42+
43+
```
44+
pip install torch_scatter torch_sparse -f https://data.pyg.org/whl/torch-${TORCH}+${CUDA}.html
45+
```
46+
where `${TORCH}` and `${CUDA}` should be replaced by the specific PyTorch and
47+
CUDA versions, respectively.
48+
49+
For example, for PyTorch 2.6.0 and CUDA 12.4, type:
50+
```
51+
pip install torch_scatter torch_sparse -f https://data.pyg.org/whl/torch-2.6.0+cu124.html
52+
```
53+
54+
[Mambaforge]: https://github.com/conda-forge/miniforge
55+
[Docker]: https://www.docker.com
56+
[PyTorch]: http://pytorch.org
57+
[PyTorch Scatter]: https://github.com/rusty1s/pytorch_scatter
58+
[PyTorch Sparse]: https://github.com/rusty1s/pytorch_sparse

docs/notebooks/example.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
],
145145
"metadata": {
146146
"kernelspec": {
147-
"display_name": "Python 3.9.12 ('squidpy39')",
147+
"display_name": "Python 3 (ipykernel)",
148148
"language": "python",
149149
"name": "python3"
150150
},
@@ -158,7 +158,7 @@
158158
"name": "python",
159159
"nbconvert_exporter": "python",
160160
"pygments_lexer": "ipython3",
161-
"version": "3.11.3"
161+
"version": "3.10.12"
162162
},
163163
"vscode": {
164164
"interpreter": {

0 commit comments

Comments
 (0)