Skip to content

Commit 6eec53c

Browse files
Merge pull request #337 from jeromekelleher/0.2.0-docs
0.2.0 docs
2 parents 5f4613f + a32dfde commit 6eec53c

File tree

11 files changed

+735
-473
lines changed

11 files changed

+735
-473
lines changed

c/tskit/tables.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1992,7 +1992,7 @@ assumptions, if the tables are not already indexed, we index the tables
19921992
before writing to file to save the cost of building these indexes at
19931993
load time. This behaviour requires that the tables are sorted.
19941994
If this automatic indexing is not desired, it can be disabled using
1995-
the :c:macro:`TSK_NO_BUILD_INDEXES` option.
1995+
the `TSK_NO_BUILD_INDEXES` option.
19961996
19971997
**Options**
19981998
@@ -2198,7 +2198,7 @@ int tsk_table_collection_drop_index(tsk_table_collection_t *self, tsk_flags_t op
21982198
21992199
@rst
22002200
Builds the tree traversal :ref:`indexes <sec_table_indexing>` for this table collection.
2201-
Any existing index is first dropped using :c:func:`tsk_table_collection_drop_indexes`.
2201+
Any existing index is first dropped using :c:func:`tsk_table_collection_drop_index`.
22022202
@endrst
22032203
22042204
@param self A pointer to a tsk_table_collection_t object.

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33

44
# You can set these variables from the command line.
5-
SPHINXOPTS = -W
5+
SPHINXOPTS = #-W
66
SPHINXBUILD = python3 -m sphinx
77
SOURCEDIR = .
88
BUILDDIR = _build

docs/conf.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,3 +279,53 @@ def handle_item(fieldarg, content):
279279
# TODO add an RST epilogue defining the version numbers of the Python
280280
# and C APIs. Should be simple to do the Python version. Getting C
281281
# will probably mean parsing the doxygen XML.
282+
283+
nitpicky = True
284+
nitpick_ignore = [
285+
("c:type", "int32_t"),
286+
("c:type", "uint32_t"),
287+
("c:type", "bool"),
288+
# TODO these have been triaged here to make the docs compile, but we should
289+
# sort them out properly. https://github.com/tskit-dev/tskit/issues/336
290+
("py:class", "a"),
291+
("py:class", "ndarray"),
292+
("py:class", "numpy array"),
293+
("py:class", "numpy.ndarray"),
294+
("py:class", "numpy.array"),
295+
("py:class", "array-like"),
296+
("py:class", "np.uint32"),
297+
("py:class", "np.float64"),
298+
("py:class", "np.int32"),
299+
("py:class", "np.int8"),
300+
("py:class", "dtype=np.uint32"),
301+
("py:class", "dtype=np.uint32."),
302+
("py:class", "dtype=np.int32"),
303+
("py:class", "dtype=np.int8"),
304+
("py:class", "dtype=np.float64"),
305+
("py:class", "dtype=np.int64"),
306+
("py:class", "iter"),
307+
("py:class", "iterator"),
308+
("py:class", "map"),
309+
("py:class", "array"),
310+
("py:class", "array_like"),
311+
("py:class", "File"),
312+
("py:class", "callable"),
313+
("py:class", "stream"),
314+
("py:class", "string"),
315+
("py:class", ""),
316+
("py:class", "Provenance"),
317+
("py:class", "ProvenanceValidationError"),
318+
("py:class", "function"),
319+
("py:class", "Table"),
320+
("py:const", "tskit.FORWARD"),
321+
("py:const", "tskit.REVERSE"),
322+
("py:const", "NULL"),
323+
("py:attr", "NULL"),
324+
("py:func", "numpy.round"),
325+
("py:func", "numpy.nonzero"),
326+
("py:func", "pack_bytes"),
327+
("py:func", "unpack_bytes"),
328+
("py:func", "parse_individuals"),
329+
("py:func", "parse_populations"),
330+
("py:meth", "Tree.get_num_tracked_samples"),
331+
]

docs/data-model.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ node
4848
See :ref:`sec_nodes_or_individuals` for discussion of what a "node" is.
4949

5050
individual
51-
5251
In certain situations we are interested in how nodes (representing
5352
individual homologous genomes) are grouped together into individuals
5453
(e.g., two nodes per diploid individual). For example, when we are working
@@ -709,7 +708,7 @@ Schema section (TODO).
709708
Table transformation methods
710709
============================
711710

712-
The following methods operate *in place* on a :class:`TableCollection`,
711+
The following methods operate *in place* on a :class:`.TableCollection`,
713712
transforming them while preserving information.
714713
In some applications, tables may most naturally be produced in a way that is
715714
logically consistent, but not meeting all the requirements for validity that
@@ -877,7 +876,7 @@ Consider the following example:
877876

878877
In this tree, node 4 is isolated, and therefore for any sites that are
879878
on this tree, the state that it is assigned is a special value
880-
``tskit.MISSING_DATA``, or ``-1``. See the :meth:`TreeSequence.variants`
879+
``tskit.MISSING_DATA``, or ``-1``. See the :meth:`.TreeSequence.variants`
881880
method and :class:`.Variant` class for more information on how missing
882881
data is represented.
883882

docs/installation.rst

Lines changed: 60 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,69 @@
11
.. _sec_installation:
22

3-
============
3+
############
44
Installation
5-
============
5+
############
66

7-
.. note:: This documentation is incomplete. Once we have a conda package that
8-
is installable we'll update the documentation to use that route also. However,
9-
as there are no external dependencies, pip should work well for all
10-
non-Windows users.
7+
There are two basic options for installing ``tskit``: either through
8+
pre-built binary packages using :ref:`sec_installation_conda` or
9+
by compiling locally using :ref:`sec_installation_pip`. We recommend using ``conda``
10+
for most users, although ``pip`` can be more convenient in certain cases.
11+
Tskit is installed to provide succinct tree sequence functionality
12+
to other software (such as `msprime <https://github.com/tskit-dev/msprime>`_),
13+
so it may already be installed if you use such software.
1114

12-
The tree sequence toolkit is often installed to provide succinct tree sequence functionality
13-
to other software (such as `msprime <https://github.com/tskit-dev/msprime>`_). If installing
14-
as a standalone Python module, users are encouraged to install an official release from PyPI
15-
using pip::
15+
.. _sec_installation_requirements:
1616

17-
$ python -m pip install tskit
17+
************
18+
Requirements
19+
************
20+
21+
Tskit requires Python 3.4+. There are no external C library dependencies. Python
22+
dependencies are installed automatically by ``pip`` or ``conda``.
23+
24+
.. _sec_installation_conda:
25+
26+
*****
27+
conda
28+
*****
29+
30+
Pre-built binary packages for ``tskit`` are available through
31+
`conda <https://conda.io/docs/>`_, and built using `conda-forge <https://conda-forge.org/>`_.
32+
Packages for recent version of Python are available for Linux, OSX and Windows. Install
33+
using::
34+
35+
$ conda install -c conda-forge tskit
36+
37+
38+
+++++++++++
39+
Quick Start
40+
+++++++++++
41+
42+
1. Install ``conda`` using `miniconda <https://conda.io/miniconda.html>`_.
43+
Make sure you follow the instructions to fully activate your ``conda``
44+
installation!
45+
2. Set up the `conda-forge channel <https://conda-forge.org/>`_ using
46+
``conda config --add channels conda-forge``.
47+
3. Install tskit: ``conda install tskit``.
48+
4. Try it out: ``tskit --version``.
49+
50+
51+
There are several different ways to obtain ``conda``. Please see the
52+
`anaconda installation documentation <https://docs.anaconda.com/anaconda/install/>`_
53+
for full details.
54+
55+
.. _sec_installation_pip:
56+
57+
***
58+
pip
59+
***
60+
61+
Installing using ``pip`` is somewhat more flexible than ``conda`` and
62+
may result in code that is (slightly) faster on your specific hardware.
63+
``Pip`` is the recommended method when using the system provided Python
64+
installations. Installation is straightforward::
65+
66+
$ python3 -m pip install tskit
1867

1968
For technical reasons it is not possible to install a development version directly using the
2069
GitHub URL (i.e. ``pip install git+git://...`` will not work)

docs/python-api.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -440,12 +440,12 @@ Table functions
440440

441441
.. _sec_stats_api:
442442

443-
**********
444-
Statistics
445-
**********
443+
**********************
444+
Linkage disequilibrium
445+
**********************
446446

447-
The ``tskit`` API provides methods for efficiently calculating
448-
population genetics statistics from a given :class:`.TreeSequence`.
447+
.. note:: This API will soon be deprecated in favour of multi-site extensions
448+
to the :ref:`sec_stats` API.
449449

450450
.. autoclass:: tskit.LdCalculator(tree_sequence)
451451
:members:

0 commit comments

Comments
 (0)