Skip to main content

Documentation PyPI Version Python Version Anaconda Version

arXiv DOI Ruff Contributor Covenant

CI Lint CodSpeed Badge codecov

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:

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).

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

import numpy as np
import delaynet as dn

# Generate toy data: 5 nodes, 300 time points
rng = np.random.default_rng(1520)
data = rng.standard_normal((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.reconstruct_network(data, connectivity_measure="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:

uv sync

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

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.

pip install -e ".[all]"

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

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:

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.

Copyright (c) 2024, delaynet Developers. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Metadata

Release files for delaynet 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for delaynet 0.3.3
File Size Uploaded
delaynet-0.3.3.tar.gz 80.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for delaynet 0.3.3
File Interpreter ABI Platform
delaynet-0.3.3-py3-none-any.whl Python 3 none any Details

Total release size: 185.4 kB

Release files / delaynet-0.3.3.tar.gz

Download URL delaynet-0.3.3.tar.gz
Size 80.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5069b426ac2754972e1066ee3ef587a4bc1b5ac8d4356024dba2e2745cb5b438
BLAKE2b-256 checksum
How to use checksums
cae64fc43f94e6e00d6044838078f6358f335b85ff7d2951d14fffc0a5f6f629
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 12, 2026.

Transparency log

Release files / delaynet-0.3.3-py3-none-any.whl

Download URL delaynet-0.3.3-py3-none-any.whl
Size 104.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dcc9f250a23ce09b03f2456ddd063e27a628e56e525d2202f97018c63cf608a0
BLAKE2b-256 checksum
How to use checksums
f0369301cb874fe05b4075d4719378a916eefb18ec34cb89712a81fa4a0631ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.3 This release

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page