pyconnectedness 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. pyconnectedness-0.1.0/.github/workflows/publish.yml +81 -0
  2. pyconnectedness-0.1.0/.github/workflows/tests.yml +28 -0
  3. pyconnectedness-0.1.0/.gitignore +20 -0
  4. pyconnectedness-0.1.0/CHANGELOG.md +11 -0
  5. pyconnectedness-0.1.0/CITATION.cff +25 -0
  6. pyconnectedness-0.1.0/LICENSE +674 -0
  7. pyconnectedness-0.1.0/PKG-INFO +307 -0
  8. pyconnectedness-0.1.0/README.md +268 -0
  9. pyconnectedness-0.1.0/examples/Demo.ipynb +5220 -0
  10. pyconnectedness-0.1.0/examples/Descriptives.py +77 -0
  11. pyconnectedness-0.1.0/examples/data/dy2009_returns.xlsx +0 -0
  12. pyconnectedness-0.1.0/examples/data/dy2009_vola.xlsx +0 -0
  13. pyconnectedness-0.1.0/examples/replicate_dy2009.ipynb +3623 -0
  14. pyconnectedness-0.1.0/examples/replicate_dy2012.ipynb +987 -0
  15. pyconnectedness-0.1.0/logos/bmftr.svg +280 -0
  16. pyconnectedness-0.1.0/logos/logo.svg +31 -0
  17. pyconnectedness-0.1.0/logos/prototypefund.svg +111 -0
  18. pyconnectedness-0.1.0/pyproject.toml +85 -0
  19. pyconnectedness-0.1.0/src/pyconnectedness/__init__.py +35 -0
  20. pyconnectedness-0.1.0/src/pyconnectedness/causality/__init__.py +0 -0
  21. pyconnectedness-0.1.0/src/pyconnectedness/connectedness/__init__.py +23 -0
  22. pyconnectedness-0.1.0/src/pyconnectedness/connectedness/decomposition.py +135 -0
  23. pyconnectedness-0.1.0/src/pyconnectedness/connectedness/dynamic.py +153 -0
  24. pyconnectedness-0.1.0/src/pyconnectedness/connectedness/frequency.py +185 -0
  25. pyconnectedness-0.1.0/src/pyconnectedness/connectedness/static.py +163 -0
  26. pyconnectedness-0.1.0/src/pyconnectedness/connectedness/var.py +156 -0
  27. pyconnectedness-0.1.0/src/pyconnectedness/viz/__init__.py +11 -0
  28. pyconnectedness-0.1.0/src/pyconnectedness/viz/heatmap.py +118 -0
  29. pyconnectedness-0.1.0/src/pyconnectedness/viz/network.py +160 -0
  30. pyconnectedness-0.1.0/tests/test_connectedness.py +73 -0
  31. pyconnectedness-0.1.0/tests/test_frequency.py +50 -0
  32. pyconnectedness-0.1.0/tests/test_var.py +69 -0
@@ -0,0 +1,81 @@
1
+ name: publish
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ - uses: actions/checkout@v7
16
+ with:
17
+ ref: ${{ github.event.release.tag_name }}
18
+
19
+ - uses: actions/setup-python@v7
20
+ with:
21
+ python-version: "3.12"
22
+
23
+ - name: Install build tools
24
+ run: python -m pip install --upgrade build twine
25
+
26
+ - name: Verify release version
27
+ run: |
28
+ python - <<'PY'
29
+ import os
30
+ import tomllib
31
+
32
+ with open("pyproject.toml", "rb") as f:
33
+ version = tomllib.load(f)["project"]["version"]
34
+
35
+ tag = os.environ["GITHUB_REF_NAME"].removeprefix("v")
36
+
37
+ if tag != version:
38
+ raise SystemExit(
39
+ f"Release tag {tag!r} does not match package version {version!r}"
40
+ )
41
+
42
+ print(f"Version OK: {version}")
43
+ PY
44
+
45
+ - name: Build package
46
+ run: python -m build
47
+
48
+ - name: Check distributions
49
+ run: python -m twine check dist/*
50
+
51
+ - name: Test wheel install
52
+ run: |
53
+ python -m pip install dist/*.whl
54
+ python -m pip check
55
+ python -c "import pyconnectedness; print(pyconnectedness.__version__)"
56
+
57
+ - uses: actions/upload-artifact@v7
58
+ with:
59
+ name: dist
60
+ path: dist/
61
+ if-no-files-found: error
62
+
63
+ publish:
64
+ needs: build
65
+ runs-on: ubuntu-latest
66
+
67
+ environment:
68
+ name: pypi
69
+
70
+ permissions:
71
+ id-token: write
72
+
73
+ steps:
74
+ - uses: actions/download-artifact@v7
75
+ with:
76
+ name: dist
77
+ path: dist/
78
+
79
+ - uses: pypa/gh-action-pypi-publish@release/v1
80
+ with:
81
+ packages-dir: dist/
@@ -0,0 +1,28 @@
1
+ name: tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ${{ matrix.os }}
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ os: [ubuntu-latest, windows-latest, macos-latest]
15
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - run: pip install -e ".[dev,examples]"
25
+
26
+ - run: ruff check src/
27
+
28
+ - run: pytest --cov=pyconnectedness --cov-report=term-missing
@@ -0,0 +1,20 @@
1
+ .DS_Store
2
+ .Rhistory
3
+ .venv/
4
+
5
+
6
+ __pycache__/
7
+ *.pyc
8
+ *.egg-info/
9
+ .pytest_cache/
10
+
11
+ sandbox/
12
+
13
+ .coverage
14
+ .coverage.*
15
+ .ruff_cache/
16
+
17
+ dist/
18
+ build/
19
+ .mypy_cache/
20
+ htmlcov/
@@ -0,0 +1,11 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ Animations: heatmaps, networks and time series that build up step by step, or play back one rolling window per frame.
6
+
7
+ ## 0.1.0 — 26 September 2026
8
+
9
+ First public release. It brings the connectedness framework of Diebold and Yilmaz to Python: VAR estimation with lag selection, generalized and orthogonalized forecast error variance decompositions, and the spillover tables of the 2009 and 2012 frameworks. The package provides total connectedness together with directional `TO` and `FROM` measures, `NET` connectedness, and net pairwise directional connectedness. These measures are also available in rolling-window form for dynamic connectedness analysis. The release further implements the frequency decomposition of Baruník and Křehlík (2018), whose frequency-band contributions add up to the corresponding Diebold-Yilmaz connectedness measures. Diebold-Yilmaz replication examples and numerical consistency tests are included to validate the implementation.
10
+
11
+ Visualisation tools include spillover heatmaps for connectedness matrices and directed network representations of pairwise connectedness.
@@ -0,0 +1,25 @@
1
+ cff-version: 1.2.0
2
+ title: PyConnectedness
3
+ message: >-
4
+ Please use the following citation to cite PyConnectedness in
5
+ scientific publications
6
+ type: software
7
+ authors:
8
+ - given-names: Zoran
9
+ family-names: Stoiljkovic
10
+ - given-names: Miljana
11
+ family-names: Cvetkovic
12
+ version: 0.1.0
13
+ repository-code: 'https://github.com/zstoi/PyConnectedness'
14
+ url: 'https://github.com/zstoi/PyConnectedness'
15
+ keywords:
16
+ - python
17
+ - connectedness
18
+ - spillover
19
+ - econometrics
20
+ - time-series
21
+ - systemic-risk
22
+ - diebold-yilmaz
23
+ - frequency-connectedness
24
+ - barunik-krehlik
25
+ license: GPL-3.0-or-later