cosasi
cosasi: Graph Diffusion Source Inference in Python - Published in JOSS (2022)
Science Score: 93.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 9 DOI reference(s) in README and JOSS metadata -
✓Academic publication links
Links to: joss.theoj.org, zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Keywords
Scientific Fields
Repository
COntagion Simulation And Source Identification: a Python package for graph diffusion source inference
Basic Info
- Host: GitHub
- Owner: lmiconsulting
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://cosasi.readthedocs.io/
- Size: 2.68 MB
Statistics
- Stars: 6
- Watchers: 2
- Forks: 4
- Open Issues: 0
- Releases: 2
Topics
Metadata Files
README.md
cosasi: Graph Diffusion Source Inference in Python
cosasi (COntagion Simulation And Source Identification) is a Python package for graph diffusion source inference, allowing users to:
- perform and evaluate source inference using standard techniques from literature,
- contribute innovative localization methods to a growing core library, and
- benchmark new techniques against a battery of comparable schemes.

Table of Contents
- Table of Contents
- Installation
- Getting Started
- Code Snippet
- Testing
- Contributions
- Citing
- Support
- Contact
- License
Installation
Installation via PyPI
bash
pip install cosasi
Installation via GitHub
Clone the repo from here (this repo).
Install requirements:
bash
pip install -r requirements.txt
Getting Started
Once cosasi is installed, feel free to review our tutorial introducing major functionality. Official documentation, including a detailed API reference, is available on Read the Docs.
Code Snippet
|
|
|:--:|
| Above: Carbon image of example code snippet; copy-and-paste-able version below. |
```python import networkx as nx import cosasi
G = nx.fastgnprandomgraph(100, 0.25) contagion = cosasi.StaticNetworkContagion( G=G, model="si", infectionrate=0.01, numberinfected=3, ) contagion.forward(100) I = contagion.getinfectedsubgraph(step=15) result = cosasi.sourceinference.multiplesource.netsleuth(G=G, I=I) result.evaluate(contagion.getsource()) ```
Testing
Extensive unit testing is employed throughout, with ~97% code coverage.
If you've cloned our repo from GitHub, you can cd into the root directory and run pytest via coverage:
bash
coverage run -m pytest
To read the .coverage file:
bash
coverage report
Contributions
We’d love your help! If you’d like to make an addition or improvement, please submit a pull request consisting of an atomic commit and a brief message describing your contribution.
Our contributor guide is here, and we itemize a few areas of development we’d like to prioritize for the future of cosasi here. If you find something wrong, please submit a bug report to the issue tracker. For other questions or comments, feel free to contact us directly.
Citing
If you found cosasi helpful in your work, please consider citing it with:
bibtex
@article{McCabe2022joss,
doi = {10.21105/joss.04894},
url = {https://doi.org/10.21105/joss.04894},
year = {2022},
publisher = {The Open Journal},
volume = {7},
number = {80},
pages = {4894},
author = {Lucas H. McCabe},
title = {cosasi: Graph Diffusion Source Inference in Python}, journal = {Journal of Open Source Software}
}
McCabe, L. H., (2022). cosasi: Graph Diffusion Source Inference in Python. Journal of Open Source Software, 7(80), 4894, https://doi.org/10.21105/joss.04894
Support
cosasi was developed in Forge, the technology accelerator of the Logistics Management Institute.
Contact
Questions? Reach out: - Lucas (email)
License
Owner
- Name: LMI
- Login: lmiconsulting
- Kind: organization
- Location: Tysons, VA
- Website: https://www.lmi.org/
- Repositories: 2
- Profile: https://github.com/lmiconsulting
LMI is a consultancy dedicated to powering a future-ready, high-performing government.
JOSS Publication
cosasi: Graph Diffusion Source Inference in Python
Authors
Tags
network science graph algorithms network analysis epidemics simulation communication information theoryGitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 2
- Total pull requests: 3
- Average time to close issues: 3 days
- Average time to close pull requests: 7 minutes
- Total issue authors: 2
- Total pull request authors: 1
- Average comments per issue: 11.5
- Average comments per pull request: 0.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- sara-02 (1)
Pull Request Authors
- danielskatz (3)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 47 last-month
- Total dependent packages: 1
- Total dependent repositories: 0
- Total versions: 4
- Total maintainers: 1
pypi.org: cosasi
COntagion Simulation And Source Identification
- Homepage: https://github.com/lmiconsulting/cosasi
- Documentation: https://cosasi.readthedocs.io/
- License: MIT License
-
Latest release: 0.0.4
published about 3 years ago
Rankings
Maintainers (1)
Dependencies
- coverage ==6.3.2
- ndlib ==5.1.1
- networkx ==2.8.4
- numpy ==1.20.1
- pytest ==7.1.1
- scikit_learn ==1.1.2
- scipy ==1.9.0
- six ==1.16.0
- coverage ==6.3.2
- ndlib ==5.1.1
- networkx ==2.8.7
- numpy ==1.21.4
- numpydoc *
- pydata_sphinx_theme ==0.8.1
- pytest ==7.1.1
- scikit_learn ==1.1.2
- scipy ==1.9.3
- six ==1.16.0
- sphinx-press-theme *
- sphinx_automodapi ==0.12
