Skip to main content

A package for fast numerical computation of the structural diversity index of arbitrary networks

Project description

Structural diversity index

The package structural-diversity-index implements code for fast numerical computation of the structural diversity index. The associated GitHub repository can be found here. The package's documentation ia available here.

Installation

To install the package and its dependencies you should create a python virtual environment. A detailed tutorial about virtual environments is available here. However, if you are in a hurry you can just open a terminal window and type

python3 -m venv sdi_venv

This creates a virtual environment called sdi_venv in your current directory. Next, activate the virtual environment. This is done on Unix or macOS by typing into the terminal

source sdi_venv/bin/activate

On Windows you should type

sdi_venv\Scripts\activate.bat

Once you created and activated the virtual environment you can install the structural_diversity_index package by typing into the terminal

pip install structural_diversity_index

This will install the latest version of the package in the virtual environment.

WARNING 1: Installing the package via pip will allow NOT you to use the scripts that run computations on GPUs. See below for details of how to run the scripts computing on GPUs.

WARNING 2: Installing the package into an existing virtual environment can cause the code to break due to conflicts with already existing dependencies. For this reason we advise to create a new virtual environment.

Installation for GPUs

If you are not interested in running computations on GPUs you can ignore this section.

Installing the structural_diversity_index package via pip does not enable you to run computations on GPUs. The reason is that pip cannot install Cudatoolkit (because it is not a python package).

To circumvent this issue one can use a package installer such as conda. Once you have installed conda on your computer, download the file environment.yml from the GitHub. In the terminal, go to the directory containing the environment.yml file you downloaded and type:

conda env create -f environment.yml

This will create a conda environment called sd_index and install all the dependencies necessary to computations on GPUs. Now you can set the flag on_cuda to True (see Examples.ipynb on GitHub) and computations will run on GPUs.

Tutorial

The Jupyter notebook Example.ipynb contains a detailed tutorial explaining how to use the package structural_diversity_index. You can find it here.

Extending the code

If you are interested in extending or simply playing around with the code, I have created a detailed documentation with ReadTheDocs which is available here. Have fun!

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

structural_diversity_index-0.0.7.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

structural_diversity_index-0.0.7-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file structural_diversity_index-0.0.7.tar.gz.

File metadata

File hashes

Hashes for structural_diversity_index-0.0.7.tar.gz
Algorithm Hash digest
SHA256 81fda11c3d57893d669580a7f90f2571c31035c3b2d7406c1c45d99fbc5a877f
MD5 eac95adfb79e1f6b38008ff7d2252926
BLAKE2b-256 d3c947f5aa5a973009b8d1c54aeb9f39ae1a4a575385d17484fd58c55679cbae

See more details on using hashes here.

File details

Details for the file structural_diversity_index-0.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for structural_diversity_index-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 ecb82337f9efc061c6433a458a5f68e10fd4533a67ff3f84bc257b21e3decb57
MD5 3af784eb87874ae5f465209527bfa164
BLAKE2b-256 cc66bad3fcfc88cdbb4c74543978cc1d3f4c59e9f24d48544e53cb107c4c375f

See more details on using hashes here.

Supported by

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