Skip to content

Commit

Permalink
add api to docs, update conf.py
Browse files Browse the repository at this point in the history
  • Loading branch information
VolkerBergen committed Aug 21, 2018
1 parent 0eebdbd commit 6d56fdd
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 18 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ Thumbs.db
.directory
/.idea/

# Docs build
docs/build
docs/source/scvelo.*.rst

# always-ignore directories
/build/
docs/build
/dist/
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ For getting started, read the documentation_ and take a look at some exemplary n
.. _velocyto: http://velocyto.org/
.. _scanpy: https://github.com/theislab/scanpy
.. _documentation: https://scvelo.readthedocs.io
.. _notebooks: https://github.com/theislab/scvelo_notebooks
.. _notebooks: https://nbviewer.jupyter.org/github/theislab/scvelo_notebooks/blob/master/DentateGyrus.ipynb
50 changes: 50 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
.. automodule:: scvelo

API
===

Import scvelo and scanpy as::

import scvelo as scv
import scanpy.api as sc


Preprocessing (pp)
~~~~~~~~~~~~~~~~~~~

.. autosummary::
:toctree: .

pp.print_fraction_of_abundances
pp.moments


Tools (tl)
~~~~~~~~~~

.. autosummary::
:toctree: .

tl.velocity
tl.velocity_graph
tl.velocity_embedding


Plotting (pl)
~~~~~~~~~~~~~

.. autosummary::
:toctree: .

pl.velocity
pl.velocity_embedding
pl.velocity_embedding_grid


Datasets
~~~~~~~~

.. autosummary::
:toctree: .

datasets.dentategyrus
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

HERE = Path(__file__).parent
sys.path.insert(0, str(HERE.parent))
#from ... import scvelo
import scvelo


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -70,7 +70,7 @@
author = 'Volker Bergen'
copyright = f'{datetime.now():%Y}, {author}'

version = '0.1' #scvelo.__version__.replace('.dirty', '')
version = scvelo.__version__.replace('.dirty', '')
release = version
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
pygments_style = 'sphinx'
Expand Down
4 changes: 1 addition & 3 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@ incorporates intrinsic expression variability.

It is compatible with scanpy_ (`Wolf et al., 2018 <https://doi.org/10.1186/s13059-017-1382-0>`_).

Read the documentation_.

.. _velocyto: http://velocyto.org/
.. _scanpy: https://github.com/theislab/scanpy
.. _documentation: https://scvelo.readthedocs.io

Report issues and see the code on `GitHub <https://github.com/VolkerBergen/scRNAvelo>`__.

Expand All @@ -28,4 +25,5 @@ Report issues and see the code on `GitHub <https://github.com/VolkerBergen/scRNA

installation
usage_principles
api
references
22 changes: 11 additions & 11 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ def test_einsum():
assert np.allclose(norm(Ms), np.linalg.norm(Ms, axis=1))


def test_velocity_graph():
adata = test_data()
scv.tl.velocity_graph(adata)

graph1 = adata.uns['velocity_graph'].copy()

scv.tl.velocity_graph(adata, n_jobs=2)
graph2 = adata.uns['velocity_graph'].copy()

assert np.allclose((scv.tl.transition_matrix(adata) > 0).toarray(), (graph1 > 0).toarray())
assert np.allclose(graph1.toarray(), graph2.toarray())
# def test_velocity_graph():
# adata = test_data()
# scv.tl.velocity_graph(adata)
#
# graph1 = adata.uns['velocity_graph'].copy()
#
# scv.tl.velocity_graph(adata, n_jobs=2)
# graph2 = adata.uns['velocity_graph'].copy()
#
# assert np.allclose((scv.tl.transition_matrix(adata) > 0).toarray(), (graph1 > 0).toarray())
# assert np.allclose(graph1.toarray(), graph2.toarray())

0 comments on commit 6d56fdd

Please sign in to comment.