Skip to main content

Forward-time population genetic simulation in Python

Project description

This is the README for fwdpy11, which is a Python package for forward-time population genetic simulation. It uses fwdpp as its C++ back-end.

Build status

Master:

https://travis-ci.org/molpopgen/fwdpy11.svg?branch=master

Development:

https://travis-ci.org/molpopgen/fwdpy11.svg?branch=dev

Manual

Latest/master:

https://readthedocs.org/projects/fwdpy11/badge/?version=latest

Development branch:

https://readthedocs.org/projects/fwdpy11/badge/?version=dev

Features

  • Picklable population objects
  • Parallel computation via multiprocessing or concurrent.futures.
  • Custom temporal samplers to analyze populations during a simulation may be written in pure Python.

Dependencies

The following must be present on your system:

  • GSL. This is a C library. It is available via conda.
  • pybind11. This should be installed via pip or conda as appropriate for your system.

fwdpy11 also uses fwdpp, which is included as a submodule.

License

GPLv3 or later (See COPYING)

Suppored Python version

fwdpy11 is written for Python 3. We will not modify the package to be compatible with Python 2.7.

git submodule init
git submodule update
python setup.py build_ext -i
python test.py

Note

The clang compiler is the assumed default on OS X. However, life is simpler if you use gcc. The setup.py takes a –gcc option that eliminates OS X-specific (really Xcode clang-specific) features so that an OS X/gcc build is possible.

Installation

Using pip on OS X and Linux (or pip3 as appropriate for your system):

pip install --upgrade fwdpy11

If you prefer a pip install on OS X using GCC instead of clang:

pip install --upgrade fwdpy11 --install-option=--gcc

You may or may not need to prefix the above with

CC=gcc CXX=g++

depending on wheter or not your user’s $PATH is set up to override Xcode’s symlink of gcc to clang.

Enabling assertions in the C++ code

The C++ code uses C’s assert macros in several places. These are disabled by default. However, it can be useful to enable them when hacking the code. To do so:

python setup.py build_ext -i --debug

Note

Never install the package compiled in debug mode! First, things will run much more slowly. Second, triggering an assertion will cause the Python interpreter to crash. These assertions exist as a brute-force method to help developers quickly identify bugs.

Bioconda

fwdpy11 is available through bioconda for Linux and for OS X:

conda install -c bioconda fwdpy11

The OS X build is built using gcc.

Project details


Release history Release notifications

History Node

0.1.4

History Node

0.1.3.post3

History Node

0.1.3.post2

History Node

0.1.3.post1

This version
History Node

0.1.3

History Node

0.1.3a1

History Node

0.1.3a0

History Node

0.1.2

History Node

0.1.1

History Node

0.1.post4

History Node

0.1.post3

History Node

0.1.post2

History Node

0.1.post1

History Node

0.1

History Node

0.0.1rc1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
fwdpy11-0.1.3.tar.gz (332.5 kB) Copy SHA256 hash SHA256 Source None Sep 14, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page