<div style="text-align: center; max-width: 700px; margin: 0 auto;">
<a href="https://delaynet.readthedocs.io/">
<picture>
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/cbueth/delaynet/refs/heads/main/docs/_static/dn_banner.png">
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/cbueth/delaynet/refs/heads/main/docs/_static/dn_banner_dark.png">
<img src="https://raw.githubusercontent.com/cbueth/delaynet/refs/heads/main/docs/_static/dn_banner.png" style="max-width: 80%; height: auto;" alt="delaynet logo">
</picture>
</a>
</div>
<div align="center">
<a href="">[](https://delaynet.readthedocs.io/)</a>
<a href="">[](https://pypi.org/project/delaynet/)</a>
<a href="">[](https://pypi.org/project/delaynet/)</a>
<a href="">[](https://anaconda.org/conda-forge/delaynet)</a>
</div>
<div align="center">
<a href="">[](https://github.com/astral-sh/ruff)</a>
<a href="">[](CODE_OF_CONDUCT.md)</a>
</div>
<div align="center">
<a href="">[](https://gitlab.ifisc.uib-csic.es/carlson/delaynet/-/commits/main)</a>
<a href="">[](https://gitlab.ifisc.uib-csic.es/carlson/delaynet/-/jobs)</a>
</div>
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](https://delaynet.readthedocs.io/en/latest/guide/) or
the [Documentation](https://delaynet.readthedocs.io/en/latest/).
## 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.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`](https://docs.astral.sh/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.
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.
Raw data
{
"_id": null,
"home_page": null,
"name": "delaynet",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": "Carlson B\u00fcth <code@cbueth.de>",
"keywords": "Delay Propagation, Transportation Networks, Information Flow, Information Theory",
"author": "Carlson B\u00fcth, Massimiliano Zanin",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/48/70/713847ec1745b63a0791b8b38889203fe6f9d9a5ac49060ab5b5473b4b12/delaynet-0.3.1.tar.gz",
"platform": null,
"description": "<div style=\"text-align: center; max-width: 700px; margin: 0 auto;\">\n <a href=\"https://delaynet.readthedocs.io/\">\n <picture>\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/cbueth/delaynet/refs/heads/main/docs/_static/dn_banner.png\">\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/cbueth/delaynet/refs/heads/main/docs/_static/dn_banner_dark.png\">\n <img src=\"https://raw.githubusercontent.com/cbueth/delaynet/refs/heads/main/docs/_static/dn_banner.png\" style=\"max-width: 80%; height: auto;\" alt=\"delaynet logo\">\n </picture>\n </a>\n</div>\n\n<div align=\"center\">\n\n<a href=\"\">[](https://delaynet.readthedocs.io/)</a>\n<a href=\"\">[](https://pypi.org/project/delaynet/)</a>\n<a href=\"\">[](https://pypi.org/project/delaynet/)</a>\n<a href=\"\">[](https://anaconda.org/conda-forge/delaynet)</a>\n\n</div>\n\n<div align=\"center\">\n\n<a href=\"\">[](https://github.com/astral-sh/ruff)</a>\n<a href=\"\">[](CODE_OF_CONDUCT.md)</a>\n\n</div>\n\n<div align=\"center\">\n\n<a href=\"\">[](https://gitlab.ifisc.uib-csic.es/carlson/delaynet/-/commits/main)</a>\n<a href=\"\">[](https://gitlab.ifisc.uib-csic.es/carlson/delaynet/-/jobs)</a>\n\n</div>\n\nPython package to reconstruct and analyse delay functional networks from time series.\nIt provides tools for data preparation and detrending, multiple connectivity measures\n(e.g. Granger causality, transfer entropy, correlations), optimal-lag network\nreconstruction, and network analysis.\n\n### Features\n\n- Connectivity measures with hypothesis testing and optimal-lag reconstruction\n- Network analysis: betweenness, eigenvector centrality, link density, transitivity,\n reciprocity, isolated nodes, global efficiency\n- Null-model normalisation for metrics: report z-scores vs directed G(n,m) random\n graphs (igraph-based; binary-only; on-the-fly generation)\n- Comprehensive documentation and examples\n- Tested across multiple Python versions with high coverage\n\n---\n\nFor details on how to use this package, see the\n[Guide](https://delaynet.readthedocs.io/en/latest/guide/) or\nthe [Documentation](https://delaynet.readthedocs.io/en/latest/).\n\n## Setup\n\nThis package can be installed from PyPI using pip:\n\n```bash\npip install delaynet # when public on PyPI\n```\n\nThis will automatically install all the necessary dependencies as specified in the\n`pyproject.toml` file. It is recommended to use a virtual environment, e.g., using\n`conda`, `mamba` or `micromamba` (they can be used interchangeably).\n\n```bash\nmicromamba create -n delay_net -c conda-forge python\nmicromamba activate delay_net\npip install delaynet # or `micromamba install delaynet` when on conda-forge\n```\n\n### Quickstart\n\n```python\nimport numpy as np\nimport delaynet as dn\n\n# Generate toy data: 5 nodes, 300 time points\nrng = np.random.default_rng(1520)\ndata = rng.standard_normal((300, 5))\n\n# Compute a connectivity p-value and lag for one pair\npval, lag = dn.connectivity(data[:, 0], data[:, 1], metric=\"gc\", lag_steps=10)\nprint(f\"GC p-value={pval:.3g}, best lag={lag}\")\n\n# Reconstruct a delay network (p-value matrix and lag matrix)\nweights, lags = dn.reconstruct_network(data, connectivity_measure=\"gc\", lag_steps=5)\nprint(weights.shape, lags.shape)\n```\n\n## Development Setup\n\nFor development, we recommend using [`uv`](https://docs.astral.sh/uv/) or `micromamba`\nto create a virtual environment.\nAfter cloning the repository, navigate to the root folder and\ncreate the environment.\nWhen using `uv`, the environment can be created with the following command:\n\n```bash\nuv sync\n```\n\nOr, if you prefer to use `micromamba`,\nwith the desired Python version and the dependencies.\n\n```bash\nmicromamba create -n delay_net -c conda-forge -f requirements.txt\nmicromamba activate delay_net\n```\n\nEither way, using `pip` to install the package in editable mode will also install the\ndevelopment dependencies.\n\n```bash\npip install -e \".[all]\"\n```\n\nOr, to let `micromamba` handle the dependencies, use the `requirements.txt` file\n\n```bash\nmicromamba install --file requirements.txt\npip install --no-build-isolation --no-deps -e .\n```\n\nNow, the package can be imported and used in the python environment, from anywhere on\nthe system if the environment is activated.\n\n## Set up Jupyter kernel\n\nIf you want to use `delaynet` with its environment `delay_net` in Jupyter, run:\n\n```bash\npip install --user ipykernel\npython -m ipykernel install --user --name=delay_net\n```\n\nThis allows you to run Jupyter with the kernel `delay_net` (Kernel > Change Kernel >\nim_env)\n\n## Acknowledgments\n\nThis project has received funding from the European Research Council (ERC) under the\nEuropean Union's Horizon 2020 research and innovation programme (grant agreement No\n851255).\nThis work was partially supported by the Mar\u00eda de Maeztu project CEX2021-001164-M funded\nby the MICIU/AEI/10.13039/501100011033 and FEDER, EU.\n\nCopyright (c) 2024, delaynet Developers.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n contributors may be used to endorse or promote products derived\n from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "Delay Propagation in Transportation Networks",
"version": "0.3.1",
"project_urls": {
"Changelog": "https://delaynet.readthedocs.io/en/latest/changelog/",
"Documentation": "https://delaynet.readthedocs.io/",
"Issues": "https://github.com/cbueth/delaynet/issues",
"Repository": "https://github.com/cbueth/delaynet"
},
"split_keywords": [
"delay propagation",
" transportation networks",
" information flow",
" information theory"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "b511f1a78e8f98f64a6895441a0a8708c5a8e502c2dc0a710d7379bba8f0bdb7",
"md5": "8fb3baa86694dbb1ab2f69804d2988fa",
"sha256": "9d1e71acd2149261424f127709c9fdff36f2aafd64953af3943a00289a5ea9a5"
},
"downloads": -1,
"filename": "delaynet-0.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8fb3baa86694dbb1ab2f69804d2988fa",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 94129,
"upload_time": "2025-08-14T12:13:12",
"upload_time_iso_8601": "2025-08-14T12:13:12.372849Z",
"url": "https://files.pythonhosted.org/packages/b5/11/f1a78e8f98f64a6895441a0a8708c5a8e502c2dc0a710d7379bba8f0bdb7/delaynet-0.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "4870713847ec1745b63a0791b8b38889203fe6f9d9a5ac49060ab5b5473b4b12",
"md5": "9563738846ef552f42abe9f2cf30c1dd",
"sha256": "8abcbb853f0506820ab499f1fd81642f3fde53cdf6bd92abbba277b4c1c27623"
},
"downloads": -1,
"filename": "delaynet-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "9563738846ef552f42abe9f2cf30c1dd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 72469,
"upload_time": "2025-08-14T12:13:13",
"upload_time_iso_8601": "2025-08-14T12:13:13.620476Z",
"url": "https://files.pythonhosted.org/packages/48/70/713847ec1745b63a0791b8b38889203fe6f9d9a5ac49060ab5b5473b4b12/delaynet-0.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-14 12:13:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cbueth",
"github_project": "delaynet",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "numpy",
"specs": []
},
{
"name": "scipy",
"specs": []
},
{
"name": "infomeasure",
"specs": [
[
">=",
"0.5.0"
]
]
},
{
"name": "statsmodels",
"specs": []
},
{
"name": "scikit-learn",
"specs": []
},
{
"name": "numba",
"specs": []
},
{
"name": "python-igraph",
"specs": []
},
{
"name": "synthatdelays",
"specs": [
[
">=",
"1.0.2"
]
]
},
{
"name": "pre-commit",
"specs": []
},
{
"name": "ruff",
"specs": []
},
{
"name": "pytest",
"specs": []
},
{
"name": "pytest-cov",
"specs": []
},
{
"name": "coverage",
"specs": []
},
{
"name": "sphinx",
"specs": []
},
{
"name": "myst-nb",
"specs": []
},
{
"name": "sphinx-design",
"specs": []
},
{
"name": "sphinx-book-theme",
"specs": []
},
{
"name": "sphinxcontrib-bibtex",
"specs": []
},
{
"name": "matplotlib",
"specs": []
},
{
"name": "networkx",
"specs": []
}
],
"lcname": "delaynet"
}