A package for detecting and visualizing sinks, sources, and bridges in networks.
Project description
General Info:
- Check out https://chipdelmal.github.io/MoNeT/SSBSTP for general project details!
Current Structure:
- ssb
- outputs
- data
- some_locations.csv
- kernels
- kernel_1.csv
- kernel_2.csv
- ...
- kernel_n.csv
__init__.py
ssbplots.py
clusters.py
mpc_defs.py
detector.py
simulator.py
Package Overview:
- This package provides a more convenient way to perform sink/source/bridge detection and network analysis for the MoNet project. Given a list of clusters, a list of kernels, and a network of locations, the
clusters.py
script will iterate over all clusters, and, for each one, run sink/source/bridge detection for each kernel using the specified locations. The script uses multiprocessing to compute the results for large inputs more efficiently. The results are placed in a nested dictionary such thatdictionary[c][k]
is the detector object used withc
clusters for kernelk
wherek
is the file name of the kernel. The package also comes with a plotting library for examining the results of the script in a more appealing way.
Overview of Major Files:
detector.py
: contains the class definition of theDetector
class. TheDetector
class takes in a stochastic matrix (or kernel) and a pandas DataFrame with the columns 'pop', 'lat', and 'lon'. It can then be used to perform sink/source/bridge detection on the data. There are various settings that may be used with the detector all of which are documented in the file.simulator.py
: contains the class definition of theSimulator
class. TheSimulator
class inherits fromDetector
. It is meant to contain parallelized methods that compute time-consuming quantities or perform simulations. The default starter code comes with a method that computes populations over a specified number of time steps.clusters.py
: the script for running multi-process clustering detection. This provides some default methods and is meant to be modified as necessary depending on the type of experiment to run. The starter script takes the following flags:-l
: the path to the locations CSV file (e.g. 'data/some_locations.csv')-k
: a path to a directory of kernels to use for detection. Kernels are expected to be CSV files (e.g. 'data/kernels').-o
: the name of the output folder. If unspecified, a folder named 'outputs' will be created (if it doesn't already exist) and the results will be placed in it.-c
: a comma separated string of integers representing the number of clusters to use for detection.-t
: the time step to run SSB at-p
: the number of processes to use. If unspecified, the number returned bycpu_count()
is used.-s
: the value for therandom_state
argument for K-means-e
: the experiment id, which is used for naming the resulting output file.
mpc_defs.py
: contains helper functions forclusters.py
. This is needed for multiprocessing.ssbplots.py
: a module for plotting the results of theclusters.py
script. More details about each plot are given within the file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ssb-pkg-0.1.0.tar.gz
(21.2 kB
view details)
Built Distribution
ssb_pkg-0.1.0-py3-none-any.whl
(34.7 kB
view details)
File details
Details for the file ssb-pkg-0.1.0.tar.gz
.
File metadata
- Download URL: ssb-pkg-0.1.0.tar.gz
- Upload date:
- Size: 21.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d8ac16dddcd8d5973fbcf59ad2bb94462d10ab9f9d1ddb07430e4682adda584 |
|
MD5 | d7daa8b616af1a529282d1055b8712a5 |
|
BLAKE2b-256 | ff1b9f7d891684e9ca38fc51cd94cebfa5e6d274f0d9909682e23044758245c1 |
File details
Details for the file ssb_pkg-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: ssb_pkg-0.1.0-py3-none-any.whl
- Upload date:
- Size: 34.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d166d795f8e74adc2403b5481da96e41560b91783574fafc2e7b10e419c969f9 |
|
MD5 | 336a6ffa3a30d72cc649a34e98cad3d2 |
|
BLAKE2b-256 | 5e6751533d16eb0bf96a711da62e66218f340bc92522dcf40aa72396aea8cef6 |