For a full guide on how to use this package, please see the documentation at https://resplab.github.io/leap/.
- To install this package on your computer locally, first download it from
GitHub:
git clone https://github.com/resplab/leap- Next, create a virtual environment:
cd leap
python -m venv env
source env/bin/activate- Finally, install the package using
pipand the-eflag, which makes the package editable:
pip install -e .The default simulation configuration options are found in the LEAP/processed_data/config.json
file.
To run the LEAP model from the command line, using the default settings:
leap --run-simulation --path-output PATH/TO/OUTPUT/FOLDERTo run the simulation for 1 year, starting in 2024, with the maximum age of 4,
and 10 new borns in the first year:
leap --run-simulation --time-horizon 1 --num-births-initial 10 --max-age 4 --min-year 2024 \
--path-output PATH/TO/OUTPUT/FOLDERTo specify the province and population growth scenario:
leap --run-simulation --time-horizon 1 --num-births-initial 10 --max-age 4 --province "CA" \
--min-year 2024 --population-growth-type "M3" --path-output PATH/TO/OUTPUT/FOLDERIf you would like to use your own config.json file instead of the default one:
leap --run-simulation --config PATH/TO/YOUR/CONFIG.json --path-output PATH/TO/OUTPUT/FOLDERTo run all the tests:
cd leap
pytest tests/To run a single test file:
cd leap
pytest tests/test_name.pyTo run doctests:
cd leap
pytest leap/ --doctest-modulesGitHub doesn't allow for private pages via GitHub Pages unless you're using
GitHub Enterprise. To view the documentation locally instead:
cd leap/docs
make clean
make htmlNow go to leap/docs/_build/html/index.html, and open that file in your browser. You should
now be able to navigate through the documentation webpages.