Skip to main content

A package for detecting and visualizing sinks, sources, and bridges in networks.

Project description

General Info:

Structure:

  • ssb
    • data
      • some_locations.csv
      • kernels
        • kernel_1.csv
        • kernel_2.csv
        • ...
        • kernel_n.csv
    • outputs
    • __init__.py
    • ssbplots.py
    • clusters.py
    • detector.py
    • mpc_defs.py

Package Overview:

  • This package provides a more convenient way to perform sink/source/bridge detection 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 that dictionary[c][k] is the detector object used with c clusters for kernel k where k 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 the detector class. The detector class takes in a state transition matrix (or kernel) and a pandas DataFrame with a 'pop' column and performs sink/source/bridge detection on the data. There are various other settings that may be used with the detector all of which are documented in the file.
  • clusters.py : the script for running multi-process clustering detection. The 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.
    • -n : the number of processes to use. If unspecified then the number returned by cpu_count() is used.
    • -e : the experiment id, which is used for naming the resulting output file.
  • mpc_defs.py : contains a helper function for clusters.py. This is needed for multiprocessing.
  • ssbplots.py : a module for plotting the results of the clusters.py script. More details about each plot are given within the file.

Project details


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.0.0.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

ssb_pkg-0.0.0-py3-none-any.whl (26.4 kB view details)

Uploaded Python 3

File details

Details for the file ssb-pkg-0.0.0.tar.gz.

File metadata

  • Download URL: ssb-pkg-0.0.0.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.1

File hashes

Hashes for ssb-pkg-0.0.0.tar.gz
Algorithm Hash digest
SHA256 1ab7832031e46dcc4d81df4d583e18bdb0bc8f60381ff0cd53cde9cec647a96d
MD5 d83bff40aa82a6788c3fa40a92465ec5
BLAKE2b-256 3674715d8f46a45f9ba15475e7cba30da3fc28bc4faae29d7159bf0de9480a45

See more details on using hashes here.

File details

Details for the file ssb_pkg-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: ssb_pkg-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 26.4 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/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.1

File hashes

Hashes for ssb_pkg-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a4e5a38f6badfd6351e3c84dc940f1242d467c95c04671df5b6c423723cd36d
MD5 7f083e4b9dc2e7080f9f191d5a4b4ed7
BLAKE2b-256 5a392f918a35f62417cd05d4060baffe4ba30b2521691069cdb6240bd1e9e7cd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page