Skip to content

Commit

Permalink
Merge pull request #41 from marshall-lab/develop
Browse files Browse the repository at this point in the history
merge for v0.1.0
  • Loading branch information
s-bessey authored Dec 12, 2019
2 parents 8c93988 + a735a20 commit 752ceb7
Show file tree
Hide file tree
Showing 99 changed files with 12,755 additions and 101,247 deletions.
File renamed without changes.
14 changes: 11 additions & 3 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,18 @@ jobs:
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 src --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
flake8 src --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Check code formatting with black
run: |
pip install black
black . --check
- name: Static Type Checking with mypy
run: |
pip install mypy
mypy titan
- name: Test with pytest
run: |
pip install pytest
pytest
python -m pytest
16 changes: 15 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
*.pyc
*.txt
*.png
.idea/
venv/
venv/*

__pycache__/
__pycache__/*
.python-version
poetry.lock
pyproject.toml
.pytest_cache/
.pytest_cache/*
.mypy_cache

.vscode/

ipynb/.ipynb_checkpoints/

results/*.txt
results/*/*.txt
42 changes: 17 additions & 25 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
BSD 3-Clause License
MIT License

Copyright (c) 2017, Maximilian King
All rights reserved.
Copyright (c) 2019 Marshall Lab

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Agent populations are defined as graphs (nodes connected by edges). Nodes in the

## Getting Started

To get started, install the requirements listed in the `requirements.txt` using a local python install or virtual env. Once installed, the model can be run using the `MP_simulation.py` program and configured using the `params.py` file.
To get started, install the requirements listed in the `requirements.txt` using a local python install or virtual env. Once installed, the model can be run using the `run_titan.py` program and configured using the `params.py` file.

### Prerequisites

Expand All @@ -18,36 +18,37 @@ pip install -r requirements.txt

### Installing

Currently, TITAN does not require any further installation as the source code exists within this repo in `/src`
Currently, TITAN does not require any further installation as the source code exists within this repo in `/titan`

## Running the Model

To run the model, execute the `MP_simluation.py` program within the `/src/` directory. It will natively read in the `params.py` configuration file as the input parameters for the model. These can be configured as desired for the target model setting and configuration. Other examples of calibrated settings exist within the `/settings/` directory.
To run the model, execute the `run_titan.py` program within the `/titan/` directory. It will natively read in the `params.py` configuration file as the input parameters for the model. These can be configured as desired for the target model setting and configuration. Other examples of calibrated settings exist within the `/settings/` directory.

Results of the model are generated and aggregated into the `/src/results/` directory. If the model is re-run, the existing results will be overwriten. A helper script has been written to prepare simulations for use with OSCAR, and is labelled `subTitan.sh` in the root directory.
Results of the model are generated and aggregated into the `/results/` directory. If the model is re-run, the existing results will be overwriten. A helper script has been written to prepare simulations for use with OSCAR, and is labelled `subTitan.sh` in the root directory.


### Running the tests

`python -m pytest`

TODO: Test coverage and examples.


## Built With
* [Python3.x](https://www.python.org/downloads/release/python-374/) - Programming language
* [Networkx](https://networkx.github.io/) - Network structure backend
* [Numpy](http://www.numpy.org/) - Numberical libraries
* [Numpy](http://www.numpy.org/) - Numerical libraries


## Authors

* **Lars Seeman** - *Initial work*
* **Max King** - *Continued development*
* **Sarah Bessey** - *Continued development*
* **Mary McGrath** - *Continued development*
* **Lars Seeman** - *Initial work*
* **Max King** - *Continued development*
* **Sarah Bessey** - *Continued development*
* **Mary McGrath** - *Continued development*

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

## Acknowledgments

Loading

0 comments on commit 752ceb7

Please sign in to comment.