https://github.com/cbueth/delaynet

Analyze delay propagation in transportation networks.

https://github.com/cbueth/delaynet

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.9%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Analyze delay propagation in transportation networks.

Basic Info
  • Host: GitHub
  • Owner: cbueth
  • License: bsd-3-clause
  • Language: Python
  • Default Branch: main
  • Size: 784 KB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 4
Created over 2 years ago · Last pushed 11 months ago
Metadata Files
Readme

README.md

delaynet logo
[![Documentation](https://readthedocs.org/projects/delaynet/badge/)](https://delaynet.readthedocs.io/) [![PyPI Version](https://badge.fury.io/py/delaynet.svg)](https://pypi.org/project/delaynet/) [![Python Version](https://img.shields.io/pypi/pyversions/delaynet)](https://pypi.org/project/delaynet/) [![Anaconda Version](https://anaconda.org/conda-forge/delaynet/badges/version.svg)](https://anaconda.org/conda-forge/delaynet)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.16875272.svg)](https://doi.org/10.5281/zenodo.16875272) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-1.2-4baaaa.svg)](CODE_OF_CONDUCT.md)
[![pipeline status](https://gitlab.ifisc.uib-csic.es/carlson/delaynet/badges/main/pipeline.svg)](https://gitlab.ifisc.uib-csic.es/carlson/delaynet/-/commits/main) [![coverage report](https://gitlab.ifisc.uib-csic.es/carlson/delaynet/badges/main/coverage.svg)](https://gitlab.ifisc.uib-csic.es/carlson/delaynet/-/jobs)

Python package to reconstruct and analyse delay functional networks from time series. It provides tools for data preparation and detrending, multiple connectivity measures (e.g. Granger causality, transfer entropy, correlations), optimal-lag network reconstruction, and network analysis.

Features

  • Connectivity measures with hypothesis testing and optimal-lag reconstruction
  • Network analysis: betweenness, eigenvector centrality, link density, transitivity, reciprocity, isolated nodes, global efficiency
  • Null-model normalisation for metrics: report z-scores vs directed G(n,m) random graphs (igraph-based; binary-only; on-the-fly generation)
  • Comprehensive documentation and examples
  • Tested across multiple Python versions with high coverage

For details on how to use this package, see the Guide or the Documentation.

Setup

This package can be installed from PyPI using pip:

bash pip install delaynet # when public on PyPI

This will automatically install all the necessary dependencies as specified in the pyproject.toml file. It is recommended to use a virtual environment, e.g., using conda, mamba or micromamba (they can be used interchangeably).

bash micromamba create -n delay_net -c conda-forge python micromamba activate delay_net pip install delaynet # or `micromamba install delaynet` when on conda-forge

Quickstart

```python import numpy as np import delaynet as dn

Generate toy data: 5 nodes, 300 time points

rng = np.random.defaultrng(1520) data = rng.standardnormal((300, 5))

Compute a connectivity p-value and lag for one pair

pval, lag = dn.connectivity(data[:, 0], data[:, 1], metric="gc", lag_steps=10) print(f"GC p-value={pval:.3g}, best lag={lag}")

Reconstruct a delay network (p-value matrix and lag matrix)

weights, lags = dn.reconstructnetwork(data, connectivitymeasure="gc", lag_steps=5) print(weights.shape, lags.shape) ```

Development Setup

For development, we recommend using uv or micromamba to create a virtual environment. After cloning the repository, navigate to the root folder and create the environment. When using uv, the environment can be created with the following command:

bash uv sync

Or, if you prefer to use micromamba, with the desired Python version and the dependencies.

bash micromamba create -n delay_net -c conda-forge -f requirements.txt micromamba activate delay_net

Either way, using pip to install the package in editable mode will also install the development dependencies.

bash pip install -e ".[all]"

Or, to let micromamba handle the dependencies, use the requirements.txt file

bash micromamba install --file requirements.txt pip install --no-build-isolation --no-deps -e .

Now, the package can be imported and used in the python environment, from anywhere on the system if the environment is activated.

Set up Jupyter kernel

If you want to use delaynet with its environment delay_net in Jupyter, run:

bash pip install --user ipykernel python -m ipykernel install --user --name=delay_net

This allows you to run Jupyter with the kernel delay_net (Kernel > Change Kernel > im_env)

Acknowledgments

This project has received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme (grant agreement No 851255). This work was partially supported by the María de Maeztu project CEX2021-001164-M funded by the MICIU/AEI/10.13039/501100011033 and FEDER, EU.

Owner

  • Name: Carlson Büth
  • Login: cbueth
  • Kind: user
  • Location: Palma de Mallorca, Spain

GitHub Events

Total
  • Release event: 2
  • Watch event: 1
  • Push event: 2
  • Public event: 1
  • Create event: 2
Last Year
  • Release event: 2
  • Watch event: 1
  • Push event: 2
  • Public event: 1
  • Create event: 2

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 284 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 3
  • Total maintainers: 2
pypi.org: delaynet

Delay Propagation in Transportation Networks

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 284 Last month
Rankings
Dependent packages count: 8.7%
Forks count: 30.9%
Average: 32.3%
Stargazers count: 40.8%
Dependent repos count: 49.0%
Maintainers (2)
Last synced: 10 months ago

Dependencies

.github/workflows/lint.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • psf/black stable composite
  • stefanzweifel/git-auto-commit-action v4 composite
.github/workflows/test.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/download-artifact v3 composite
  • actions/upload-artifact v3 composite
  • codecov/codecov-action v3 composite
  • conda-incubator/setup-miniconda v2 composite
environment.yml pypi
requirements.txt pypi
  • mkl *
  • numba *
  • numpy *
  • pytest *
  • scikit-learn *
  • scipy *
  • statsmodels *