Skip to main content

PyPI version Documentation Status Code style: black Downloads MIT license

cosasi (COntagion Simulation And Source Identification)

cosasi 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.

logo

Table of Contents

Installation

Installation via PyPI

pip install cosasi

Installation via GitHub

Clone the repo from here (this repo).

Install requirements:

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

carbon
Above: Carbon image of example code snippet; copy-and-paste-able version below.
import networkx as nx
import cosasi

G = nx.fast_gnp_random_graph(100, 0.25)
contagion = cosasi.StaticNetworkContagion(
   G=G,
   model="si",
   infection_rate=0.01,
   number_infected=3,
)
contagion.forward(100)
I = contagion.get_infected_subgraph(step=15)
result = cosasi.source_inference.multiple_source.netsleuth(G=G, I=I)
result.evaluate(contagion.get_source())

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:

    coverage run -m pytest

To read the .coverage file:

    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.

Support

cosasi was developed in Forge, the technology accelerator of the Logistics Management Institute.

Contact

Questions? Reach out:

License

MIT

Metadata

Release files for cosasi 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cosasi 0.0.4
File Size Uploaded Provenance
cosasi-0.0.4.tar.gz 34.6 kB Without provenance Details

Release files / cosasi-0.0.4.tar.gz

Download URL cosasi-0.0.4.tar.gz
Size 34.6 kB
Tags Source
SHA-256 checksum
How to use checksums
cdacbad79153c85e0225ad9a5f1faba02171d8f6f17aabdd7049d67c92aa8f08
BLAKE2b-256 checksum
How to use checksums
f6363cf0171a1183db33fef33bd7295425dbf60c01c280b2cbdcad27373e56d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.5

Security for cosasi 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page