Skip to content

Commit

Permalink
update tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
molpopgen committed Dec 1, 2020
1 parent 4c1e861 commit 18a27fe
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions doc/pages/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,26 @@ one-half, meaning that each region is assorting independently (50 `cM` between e
As an aside, this example is not creating objects in order by their positions. Such ordering is not required.

Beginning in version ``0.12.0``, it is possible to restrict crossover positions to integer values.
For the examples given above, crossover positions are floating-point values sampled uniformly from :math:`[beg, end)`.
To restrict positions to integer values, we pass ``discrete=True`` when creating object instances:

.. jupyter-execute::

recregions = [
fwdpy11.PoissonInterval(beg=0, end=5, mean=2e-3 / 3, discrete=True),
fwdpy11.PoissonInterval(beg=5, end=10, mean=1e-3 / 3, discrete=True),
]

Now, breakpoints from the first region will only take on values of ``0``, ``1``, ``2``, ``3``, or ``4``.

Setting ``discrete=True`` requires the following:

* Values for ``beg`` and ``end`` must be :class:`int`. Thus, ``1`` is valid but ``1.0`` will raise a ``TypeError``.
* ``end - beg`` must be ``> 1``. This requirement prevents you from using ``beg=0`` and ``end=1``, for example,
which would result in the only possible crossover position being ``0``.


The following classes are available:

* :class:`fwdpy11.PoissonInterval`
Expand Down

0 comments on commit 18a27fe

Please sign in to comment.