Coder Social home page Coder Social logo

cwiswell-idm / synthpops Goto Github PK

View Code? Open in Web Editor NEW

This project forked from institutefordiseasemodeling/synthpops

0.0 1.0 0.0 67.23 MB

Create synthetic populations for COVID-19 epidemic analyses.

Home Page: https://institutefordiseasemodeling.github.io/synthpops/index.html

License: Other

Python 99.93% Shell 0.07%

synthpops's Introduction

SynthPops

SynthPops is a module designed to generate synthetic populations that are used for COVID-19 (SARS-CoV-2) epidemic analyses. SynthPops can create generic populations with different network characteristics, as well as synthetic populations that interact in different layers of a multilayer contact network.

The code was developed to explore the impact of contact tracing and testing in human contact networks in combination with our Covasim repository.

More extensive installation and usage instructions are in the SynthPops documentation.

Installation

Python >=3.6 is required. Python 2 is not supported. Virtual environments are recommended but not required.

To install, first clone the GitHub repository, and then type:

python setup.py develop

Note: while synthpops can also be installed via pypi, this method does not currently include the data files which are required to function, and thus is not recommended.

Quick Start

The following code creates a synthetic population for Seattle, Washington::

import synthpops as sp

sp.validate()

datadir = sp.datadir # this should be where your demographics data folder resides

location = 'seattle_metro'
state_location = 'Washington'
country_location = 'usa'
sheet_name = 'United States of America'
level = 'county'

npop = 10000 # how many people in your population
sp.generate_synthetic_population(npop,datadir,location=location,
                                 state_location=state_location,country_location=country_location,
                                 sheet_name=sheet_name,level=level)

Usage

In addition to the documentation, see the examples folder for usage examples.

Structure

All core modeling is in the synthpops folder; standard usage is import synthpops as sp.

data

The data folder contains demographic data needed and some pre-generated contact networks for populations of different sizes. Please update synthpops.datadir to point at this directory.

licenses

The licenses folder contains:

  • NOTICE: Third-party software notices and information
  • notice.py: Scraper to auto-generate the NOTICE file.

synthpops

The synthpops folder contains:

  • __init__.py
  • api.py
  • config.py: Methods to set where datadir points; this should be the path to the data folder.
  • contact_networks.py: Functions to create a synthetic population with demographic data and places people into households, schools, and workplaces.
  • contacts.py: Functions to create other types of contact networks and load multilayer networks.
  • plot_tools.py: Functions to plot an age-mixing matrix for a layer in the contact network.
  • synthpops.py: Functions to call in demographic data and sampling functions.
  • version.py: Version and date.

tests

The tests folder contains tests of different functions available in SynthPops.

Disclaimer

The code in this repository was developed by IDM to support our research in disease transmission and managing epidemics. We’ve made it publicly available under the Creative Commons Attribution-Noncommercial-ShareAlike 4.0 License to provide others with a better understanding of our research and an opportunity to build upon it for their own work. We make no representations that the code works as intended or that we will provide support, address issues that are found, or accept pull requests. You are welcome to create your own fork and modify the code to suit your own modeling needs as contemplated under the Creative Commons Attribution-Noncommercial-ShareAlike 4.0 License.

synthpops's People

Contributors

dmistry-idm avatar cliffckerr avatar lmgeorge avatar mfisher-idmod avatar jschripsema-idm avatar cwiswell-idm avatar mizzo-idm avatar celiot-idm avatar devclinton avatar romesha avatar clorton avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.