Python port of Temporal Mapper 2 -- build attractor transition networks from time-series data
Project description
tmapper (Python)
A Python port of Temporal Mapper 2, a toolbox for building attractor transition networks from time-series data.
Status: feature-complete port. Both the core two-step pipeline (tknndigraph + filtergraph + plotting) and the secondary cycle/path analysis toolkit (cycle counting/clustering, path decomposition, traffic, modularity) are ported and tested. tknngraph.m (a legacy, unused MATLAB function) was intentionally not ported.
For the full background, citation, and the original MATLAB implementation, see tmapper2.
Documentation, quickstart, and full API reference: https://multiscale-complex-systems-lab.github.io/tmapper-py/
What's included
- Core pipeline:
tknndigraph,filtergraph,find_node_label,tcm_distance,plot_tmgraph,plot_tmgraph_tcm,plot_tmgraph_interactive(draggable/zoomable/hoverable HTML via pyvis, no MATLAB equivalent) - Standalone graph builders:
knngraph,cknngraph - Graph/data utilities:
node_size,node_measure,normalize_geodesic,normalize_tcm,members_to_tidx,subgraph_from_members,sym_dyn_to_digraph,digraph_to_graph,find_blocks - Cycle/path analysis toolkit:
cycle_count(Giscard/Kriege/Wilson combinatorial-sieve counter, third-party algorithm carrying its own BSD license -- seecycle_count.py),cycle_count2p,reorg_cycles,cycle_path_overlap,cycle_cluster,cycle_cluster_conn,cycle_cutter,cycles_to_paths,cycle_path_decomp,path_traffic,qasym,cal_mod - Interactive app:
tmapper-app, a browser front end for the whole pipeline -- see below
All ported functions were cross-checked node-for-node and edge-for-edge against real MATLAB output on deterministic test graphs (see the test suite for the same hand-derived oracle values used in the MATLAB toolbox's own tests/).
Installation
pip install tmapper-py # library
pip install "tmapper-py[app]" # library + the interactive app
(The distribution is tmapper-py -- tmapper alone isn't available on PyPI,
see Installation.
Everything imports as import tmapper either way.)
For development, from a clone:
git clone https://github.com/Multiscale-Complex-Systems-Lab/tmapper-py.git
cd tmapper-py
pip install -e ".[app,test]"
Interactive app
Prefer point-and-click? tmapper-app runs the same pipeline in your browser -- load data, pick variables, turn the parameters, and explore the network without writing any code:
pip install "tmapper-py[app]"
tmapper-app
It handles missing data and downsampling for you (dropping incomplete rows before an anti-aliasing lowpass), exports both figures and analysis-ready data (interactive HTML, PNGs, a per-timepoint timeline.csv, GraphML, and a provenance JSON), and shows a runnable script reproducing the current build.
See the Interactive App guide for a full walkthrough.
Running tests
pytest
Notes for users porting workflows from MATLAB
- Node labels are 0-indexed (Pythonic), unlike the MATLAB original's 1-indexed convention.
- If you z-score your data before calling
tknndigraph(astmapper_demo.mdoes), note that MATLAB'szscoredivides by the sample standard deviation (N-1), whilescipy.stats.zscoredefaults to the population standard deviation (N). Passddof=1toscipy.stats.zscoreto match MATLAB's convention -- otherwise results can subtly diverge near k-NN/threshold boundaries. (Verified: withddof=1, the Python and MATLAB pipelines produce identical output down to floating-point precision on the sample dataset.)
License
BSD 3-Clause License -- see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tmapper_py-0.1.0.tar.gz.
File metadata
- Download URL: tmapper_py-0.1.0.tar.gz
- Upload date:
- Size: 517.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42aa8c88ba07c296613183137054bbbdef6cea77383207b8668a51e8dd62eaa2
|
|
| MD5 |
d43ee2581587e67e7f48ceba17d66d74
|
|
| BLAKE2b-256 |
d677245769902adcfcc550abe0aa6b39b29d2a943eca61fd467de73d2128a8e6
|
Provenance
The following attestation bundles were made for tmapper_py-0.1.0.tar.gz:
Publisher:
publish.yml on Multiscale-Complex-Systems-Lab/tmapper-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tmapper_py-0.1.0.tar.gz -
Subject digest:
42aa8c88ba07c296613183137054bbbdef6cea77383207b8668a51e8dd62eaa2 - Sigstore transparency entry: 2262170958
- Sigstore integration time:
-
Permalink:
Multiscale-Complex-Systems-Lab/tmapper-py@b883da26d414ac971c3d53830f89576bd1f48493 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/Multiscale-Complex-Systems-Lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b883da26d414ac971c3d53830f89576bd1f48493 -
Trigger Event:
release
-
Statement type:
File details
Details for the file tmapper_py-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tmapper_py-0.1.0-py3-none-any.whl
- Upload date:
- Size: 500.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b134c7bd7edfcd17cf7879bc3909e582e8f5bd293c82c855b34bd4ed24d8d2a
|
|
| MD5 |
61009029747e9c3c8b61443d567253c9
|
|
| BLAKE2b-256 |
66c724a7f4aaa9f76ca8fb5db50aaad7f3efe93dbaecfca011b0da167fa112b6
|
Provenance
The following attestation bundles were made for tmapper_py-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Multiscale-Complex-Systems-Lab/tmapper-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tmapper_py-0.1.0-py3-none-any.whl -
Subject digest:
0b134c7bd7edfcd17cf7879bc3909e582e8f5bd293c82c855b34bd4ed24d8d2a - Sigstore transparency entry: 2262171242
- Sigstore integration time:
-
Permalink:
Multiscale-Complex-Systems-Lab/tmapper-py@b883da26d414ac971c3d53830f89576bd1f48493 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/Multiscale-Complex-Systems-Lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b883da26d414ac971c3d53830f89576bd1f48493 -
Trigger Event:
release
-
Statement type: