A set of recursive population models for ecologists
A set of recursive population models for ecologists including:
- Nicholson Bailey host-parasitoid model
- Weed-herbivore coupled model for an annual plant that forms a seed bank from Buckley et al. 2005
- Weed-herbivore model for a biennial plant that forms a seed bank
Generations is available from the Python Package Index. It can be installed using
pip install generations
Once installed, the user can run the various models in
generations by entering the following commands. Python's
-m flag imports and runs the specified module. Each population model in
generations is in it's own module:
python -m generations.nicholson_bailey python -m generations.buckley python -m generations.biennial
Generations requires the Bokeh Python package to generate interactive plots of the simulation outputs in the browser. This functionality is attached to each modeling module. When the module runs, it automatically generates a .csv of the population densities for each organism at each time step Bokeh uses that .csv to automatically generate an html page with an interactive plot of the results in the user's browser.
The user can also create a copy of the default configuration file for the population model modules in their working directory. The file will be named
python -m generations.create_config
The user can then edit parameters to fit their desired ecological system. Model parameters will be loaded from the working directory into the population models at runtime.
Generations source code is available on GitHub.
git clone https://github.com/alfalimajuliett/generations.git
This will run the unit tests. If you have pipenv, it will also run a number of other checks:
yapf: reformat the code automatically
mypy: check for runtime errors like misnamed imports or variables, or incompatible types
tox: run the unit tests against Python 2.7 and 3.7
coverage: report on lines that are not covered by unit tests
Uploading to PyPI
Install pipenv if you don't have it.
Increment the version in
Run the tests one last time:
Build the distribution files:
pipenv run python3 setup.py sdist bdist_wheel
twine. It will prompt for your PyPI password:
pipenv run twine upload dist/*
Commit the version, create a tag, and push tags:
git commit -am "$version" git tag $version git push --tags git push
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size generations-1.3.0-py3-none-any.whl (13.6 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size generations-1.3.0.tar.gz (7.6 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for generations-1.3.0-py3-none-any.whl