This library includes convenience functions and scripts to support species distribution modeling (SDM) efforts. This includes a python wrapper for MaxEnt and tools for translating GBIF- and MaxEnt-format datasets to traditional geospatial formats.
The easiest way is to install via conda. Make sure you have conda
installed (either via minconda (recommended) or anaconda).
git clone https://github.com/stanford-ccb/ccb.git
cd ccb/
conda env update
Once you've created the environment, activate it and install ccb
.
conda activate ccb
pip install .
Then you should have a conda environment you can actiave with conda activate ccb
. You can then e.g. run the executable vector-to-maxent -h
, or import ccb
in python from this environment.
If you're interested in using the ccb default ipython
profile, you can set an environment variable to do this for you. From the base ccb
directory, run the following:
conda activate ccb
conda install ipython
conda env config vars set IPYTHONDIR=$PWD/ipython
You'll have to run conda deactivate
then conda activate ccb
for the changes to take effect. After that you'll be able to run ipython
with our default settings.
Clone the repository and create a system ccb
install.
git clone https://github.com/stanford-ccb/ccb.git
cd ccb
pip install -r requirements.txt .
There are three external dependencies you'll need to setup in this pathway. First is gdal
. Next is open-jdk
. Last is GEOS
, a dependency for shapely
.
External contribution guidelines are not formally supported at this time--reach out to the package developers to facilitate contributions.
A separate conda
development environment was created to facilitate contributing well-formatted code to ccb
. Create this environment with the following command.
conda env create --file=environment-dev.yml
This environment contains additional code formatting libraries, including black
, flake8
, isort
and pytest
. These tools are automatically applied to all code commits via the pre-commit
library. To install pre-commit
, run the following command:
pre-commit install
pre-commit
behavior is defined in .pre-commit-config.yaml
, specifying how to format the code, and cleaning up any formatting issues prior to accepting any commit. This should ensure that all pull requests are well-formatted.