Skip to content

Commit

Permalink
update pinnings of demes, demesdraw, and msprime to demes~=0.2.0
Browse files Browse the repository at this point in the history
* API and test fixes
* add test of two sources for a pulse
* pin numpy to < 1.21.(for numba)
  • Loading branch information
molpopgen committed Dec 10, 2021
1 parent c063db5 commit d74161f
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 73 deletions.
2 changes: 2 additions & 0 deletions doc/misc/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Dependencies:

* Clean up pinning of `demes` and `demesdraw`.
PR {pr}`869`
* Update to `demes` ~=0.2.0.
PR {pr}`873`

## 0.17.0a3

Expand Down
3 changes: 2 additions & 1 deletion doc/requirements.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
jupyter-book
matplotlib
msprime>=1.0.1
numpy<1.21.0
pandas
sphinx-issues
demesdraw==0.1.4
demesdraw~=0.2.0
62 changes: 25 additions & 37 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.8
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile
Expand All @@ -8,13 +8,14 @@ alabaster==0.7.12
# via sphinx
anyio==3.4.0
# via jupyter-server
argon2-cffi==21.1.0
argon2-cffi==21.2.0
# via
# jupyter-server
# notebook
argon2-cffi-bindings==21.2.0
# via argon2-cffi
attrs==21.2.0
# via
# -c ../requirements.in
# demes
# jsonschema
# jupyter-cache
Expand All @@ -33,8 +34,8 @@ bleach==4.1.0
certifi==2021.10.8
# via requests
cffi==1.15.0
# via argon2-cffi
charset-normalizer==2.0.8
# via argon2-cffi-bindings
charset-normalizer==2.0.9
# via requests
click==7.1.2
# via
Expand All @@ -51,12 +52,11 @@ decorator==5.1.0
# via ipython
defusedxml==0.7.1
# via nbconvert
demes==0.1.2
demes==0.2.1
# via
# -c ../requirements.in
# demesdraw
# msprime
demesdraw==0.1.4
demesdraw==0.2.0
# via -r requirements.in
docutils==0.16
# via
Expand All @@ -74,7 +74,7 @@ entrypoints==0.3
# via
# jupyter-client
# nbconvert
fonttools==4.28.2
fonttools==4.28.3
# via matplotlib
gitdb==4.0.9
# via gitpython
Expand All @@ -90,13 +90,11 @@ imagesize==1.3.0
# via sphinx
importlib-metadata==4.8.2
# via myst-nb
importlib-resources==5.4.0
# via sphinx-jupyterbook-latex
ipykernel==6.5.1
ipykernel==6.6.0
# via
# ipywidgets
# notebook
ipython==7.29.0
ipython==7.30.1
# via
# ipykernel
# ipywidgets
Expand Down Expand Up @@ -144,7 +142,7 @@ jupyter-core==4.9.1
# nbconvert
# nbformat
# notebook
jupyter-server==1.12.0
jupyter-server==1.13.0
# via
# jupyter-server-mathjax
# nbdime
Expand Down Expand Up @@ -185,10 +183,8 @@ mdit-py-plugins==0.2.8
# myst-parser
mistune==0.8.4
# via nbconvert
msprime==1.0.3
# via
# -c ../requirements.in
# -r requirements.in
msprime==1.0.4
# via -r requirements.in
myst-nb==0.13.1
# via jupyter-book
myst-parser==0.15.2
Expand Down Expand Up @@ -217,7 +213,7 @@ nbformat==5.1.3
# nbconvert
# nbdime
# notebook
nest-asyncio==1.5.1
nest-asyncio==1.5.4
# via
# jupyter-client
# nbclient
Expand All @@ -228,7 +224,7 @@ notebook==6.4.6
# via widgetsnbextension
numpy==1.20.3
# via
# -c ../requirements.in
# -r requirements.in
# demesdraw
# matplotlib
# msprime
Expand All @@ -245,7 +241,7 @@ pandas==1.3.4
# via -r requirements.in
pandocfilters==1.5.0
# via nbconvert
parso==0.8.2
parso==0.8.3
# via jedi
pexpect==4.8.0
# via ipython
Expand All @@ -257,7 +253,7 @@ prometheus-client==0.12.0
# via
# jupyter-server
# notebook
prompt-toolkit==3.0.22
prompt-toolkit==3.0.24
# via ipython
ptyprocess==0.7.0
# via
Expand Down Expand Up @@ -318,17 +314,13 @@ ruamel.yaml==0.17.17
ruamel.yaml.clib==0.2.6
# via ruamel.yaml
scipy==1.7.3
# via
# -c ../requirements.in
# demesdraw
# via demesdraw
send2trash==1.8.0
# via
# jupyter-server
# notebook
setuptools-scm==6.3.2
# via
# -c ../requirements.in
# matplotlib
# via matplotlib
six==1.16.0
# via
# bleach
Expand All @@ -344,7 +336,7 @@ snowballstemmer==2.2.0
# via sphinx
soupsieve==2.3.1
# via beautifulsoup4
sphinx==4.3.0
sphinx==4.3.1
# via
# jupyter-book
# jupyter-sphinx
Expand Down Expand Up @@ -434,10 +426,8 @@ traitlets==5.1.1
# nbformat
# notebook
tskit==0.3.7
# via
# -c ../requirements.in
# msprime
typing-extensions==4.0.0
# via msprime
typing-extensions==4.0.1
# via gitpython
uc-micro-py==1.0.1
# via linkify-it-py
Expand All @@ -447,16 +437,14 @@ wcwidth==0.2.5
# via prompt-toolkit
webencodings==0.5.1
# via bleach
websocket-client==1.2.1
websocket-client==1.2.3
# via jupyter-server
wheel==0.37.0
# via sphinx-togglebutton
widgetsnbextension==3.5.2
# via ipywidgets
zipp==3.6.0
# via
# importlib-metadata
# importlib-resources
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# setuptools
52 changes: 29 additions & 23 deletions fwdpy11/_functions/import_demes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@

from .. import class_decorators
from .._demography import exponential_growth_rate
from ..demographic_models import (DemographicModelCitation,
DemographicModelDetails)
from ..discrete_demography import (DiscreteDemography, MassMigration,
MigrationMatrix, SetDemeSize,
SetExponentialGrowth, SetMigrationRates,
SetSelfingRate, copy_individuals,
move_individuals)
from ..demographic_models import DemographicModelCitation, DemographicModelDetails
from ..discrete_demography import (
DiscreteDemography,
MassMigration,
MigrationMatrix,
SetDemeSize,
SetExponentialGrowth,
SetMigrationRates,
SetSelfingRate,
copy_individuals,
move_individuals,
)


# TODO: need type hints for dg
Expand Down Expand Up @@ -614,24 +619,25 @@ def _process_pulses(
) -> None:
for p in dg.pulses:
when = burnin_generation + int(model_times.model_start_time - p.time - 1)
events.migration_rate_changes.append(
_MigrationRateChange(
when=when,
source=idmap[p.source],
destination=idmap[p.dest],
rate_change=p.proportion,
from_deme_graph=False,
for source, proportion in zip(p.sources, p.proportions):
events.migration_rate_changes.append(
_MigrationRateChange(
when=when,
source=idmap[source],
destination=idmap[p.dest],
rate_change=proportion,
from_deme_graph=False,
)
)
)
events.migration_rate_changes.append(
_MigrationRateChange(
when=when + 1,
source=idmap[p.source],
destination=idmap[p.dest],
rate_change=-p.proportion,
from_deme_graph=False,
events.migration_rate_changes.append(
_MigrationRateChange(
when=when + 1,
source=idmap[source],
destination=idmap[p.dest],
rate_change=-proportion,
from_deme_graph=False,
)
)
)


def _process_admixtures(
Expand Down
4 changes: 2 additions & 2 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# with requirements.in and doc/requirements.in
# and may require regenerating the .txt files.
pybind11[global]
numpy
numpy<1.21.0
sparse
scipy
attrs
black
demes==0.1.2
demes~=0.2.0

#below are for building package
#and running tests
Expand Down
12 changes: 5 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ attrs==21.2.0
# flake8-bugbear
# jsonschema
# pytest
black==21.11b1
black==21.12b0
# via
# -r requirements.in
# blacken-docs
blacken-docs==1.12.0
# via -r requirements.in
click==8.0.3
# via black
demes==0.1.2
demes==0.2.1
# via
# -r requirements.in
# msprime
Expand All @@ -29,7 +29,7 @@ flake8==4.0.1
# via
# -r requirements.in
# flake8-bugbear
flake8-bugbear==21.9.2
flake8-bugbear==21.11.29
# via -r requirements.in
iniconfig==1.1.1
# via pytest
Expand All @@ -39,7 +39,7 @@ llvmlite==0.37.0
# via numba
mccabe==0.6.1
# via flake8
msprime==1.0.3
msprime==1.0.4
# via -r requirements.in
mypy-extensions==0.4.3
# via black
Expand Down Expand Up @@ -90,8 +90,6 @@ pytest-forked==1.3.0
# via pytest-xdist
pytest-xdist==2.4.0
# via -r requirements.in
regex==2021.11.10
# via black
ruamel.yaml==0.17.17
# via demes
ruamel.yaml.clib==0.2.6
Expand All @@ -116,7 +114,7 @@ tskit==0.3.7
# via
# -r requirements.in
# msprime
typing-extensions==4.0.0
typing-extensions==4.0.1
# via black

# The following packages are considered to be unsafe in a requirements file:
Expand Down
2 changes: 1 addition & 1 deletion requirements/conda_minimal_deps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ autoconf
automake
pytest
pytest-xdist
demes
demes==0.2.0
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ install_requires =
numpy
sparse
tskit >= 0.3.6
demes == 0.1.2
demes ~= 0.2.0
setup_requires =
setuptools
setuptools_scm
Expand Down

0 comments on commit d74161f

Please sign in to comment.