Skip to main content

pyGDIS logo

pyGDIS

Tests Build Python License: MIT Version

pyGDIS is the reference Python implementation of the Generalized Dynamical Instability Score (GDIS), a descriptor-based framework for quantifying nonlinear instability and localized critical-transition behavior across parameter-ordered trajectory families.

The package implements the formulation used in the accompanying manuscript and separates reusable scientific software from paper-specific benchmarking and plotting code.

Why GDIS?

Conventional measures often emphasize one manifestation of nonlinear behavior. GDIS combines complementary channels within a bounded and interpretable architecture.

Measure Primary emphasis Bounded cross-system score Localized transition term
Lyapunov exponent / FTLE Perturbation divergence No No
Entropy measures Informational complexity Often No
Recurrence measures Recurrence geometry Depends Indirect
GDIS Dynamical, geometric, informational, and temporal evidence Yes Yes

GDIS is intended to complement—not replace—established nonlinear-dynamics tools.

Mathematical formulation

The reference implementation computes five descriptors:

  • J: local dynamical sensitivity
  • S: trajectory stretching
  • A: attractor expansion
  • H: nonlinear complexity
  • T: temporal persistence

The principal descriptors are aggregated through a weighted geometric mean,

$$ C = \left(\widetilde J^{\alpha_J}\widetilde S^{\alpha_S}\widetilde A^{\alpha_A}\right)^{1/(\alpha_J+\alpha_S+\alpha_A)}, $$

with reference exponents

$$ \alpha_J=0.42,\qquad \alpha_S=0.33,\qquad \alpha_A=0.25. $$

After complexity and persistence modulation and Hill saturation, the sustained-instability functional is combined with an unweighted transition-localization term through

$$ \Phi = -\ln(1-I_{\mathrm{sustained}}) + \lambda_t I_{\mathrm{transition,base}}, $$

followed by

$$ \mathrm{GDIS}=1-e^{-\Phi},\qquad 0\leq \mathrm{GDIS}<1. $$

The default reference value is lambda_t = 0.18.

Hierarchical GDIS architecture

Mathematical properties

The implementation preserves the properties established in the manuscript:

  • Boundedness: 0 <= GDIS < 1.
  • Monotonicity: increasing sustained or transition instability cannot decrease GDIS.
  • Baseline preservation: when the transition term is zero, GDIS equals the sustained-instability functional.
  • Robust scale handling: percentile normalization is invariant to positive affine transformations of its input descriptor.

Installation

python -m pip install pygdis

For development:

git clone https://github.com/hamiddi/pygdis.git
cd pygdis
python -m pip install -e ".[dev]"
pytest

Quick start

from gdis import GDIS
from gdis.benchmarks import LorenzSystem

system = LorenzSystem()
trajectories, parameters = system.generate_sweep()

result = GDIS().fit_transform(
    trajectories,
    parameters,
    jacobian_function=system.jacobian,
    critical_value=system.critical_value,
)

print(result.to_dataframe().head())
result.plot()

Data-only use

When an analytical Jacobian is unavailable, omit jacobian_function. pyGDIS uses a trajectory-based local-divergence proxy.

result = GDIS().fit_transform(trajectories, parameters)

If critical_value is omitted, the reference implementation centers the transition-localization window at the maximum transition-energy estimate and records this choice in result.metadata.

Analyze trajectory data from CSV

The repository includes a complete long-format example dataset at examples/synthetic_parameter_sweep.csv. Each row contains a control parameter, time, and two observed state variables:

parameter,time,x1,x2
0.000000,0.000000,...,...
0.000000,0.100334,...,...

Run the included end-to-end analysis:

cd examples
python csv_data_example.py

The script creates gdis_results/ beside the CSV file.

The script loads and groups the CSV into parameter-ordered trajectories, computes GDIS in data-only mode, and writes:

  • gdis_results.csv with the final score, potential, functionals, and descriptors;
  • gdis_profile.png;
  • gdis_components.png; and
  • analysis_summary.txt.

To analyze a user-supplied file:

python csv_data_example.py \
  --input my_data.csv \
  --parameter-column load \
  --time-column time \
  --state-columns voltage angle

See CSV analysis in the usage guide for the required format and interpretation of outputs.

Package organization

src/gdis/
├── components.py       # J, S, A, H, and T descriptors
├── scaling.py          # robust normalization and saturation
├── transition.py       # transition energy and localization
├── potential.py        # Phi and bounded GDIS mapping
├── score.py            # reference end-to-end GDIS estimator
├── sensitivity.py      # transition-weight rescoring
├── validation.py       # optional validation metrics
├── plotting.py         # reusable plotting helpers
├── benchmarks/         # canonical benchmark access
└── systems/            # Lorenz, Rössler, Chen, and logistic systems

Paper-specific workflows are intentionally isolated under examples/publication/ and are not imported by the core package.

Reproducing the manuscript analyses

python scripts/reproduce_paper.py

Or run the stages separately:

python examples/publication/reproduce_benchmarks_and_sensitivity.py
python examples/publication/reproduce_publication_figures.py

These scripts reproduce the canonical benchmark sweep, transition-weight sensitivity analysis, validation tables, attractor galleries, and publication figures. They are research-reproduction workflows rather than core API modules.

Transition-weight sensitivity

A completed result can be rescored without recomputing trajectories or descriptors:

from gdis import transition_weight_sensitivity

sensitivity = transition_weight_sensitivity(
    result,
    weights=(0.0, 0.18, 0.25, 0.50, 0.75, 1.0),
)

Documentation

Companion manuscript

Generalized Dynamical Instability Score (GDIS): A Universal Framework for Quantifying Instability and Critical Transitions in Nonlinear Dynamical Systems

The manuscript is being submitted to IEEE Access. Publication metadata and DOI will be added after acceptance. Supplementary material accompanies the manuscript.

Citation

Until the journal article is published, cite the software repository using CITATION.cff. A temporary BibTeX entry is:

@software{ismail_pygdis_2026,
  author  = {Ismail, Hamid D. and Harb, Ahmad and Bikdash, Marwan},
  title   = {pyGDIS: Generalized Dynamical Instability Score},
  year    = {2026},
  version = {1.0.0},
  url     = {https://github.com/hamiddi/pygdis}
}

Scope and interpretation

This release implements the manuscript's reference formulation. The descriptor set, weighting strategy, and transition-localization method are modular and may be extended for application-specific studies. The current benchmark evidence supports broad cross-system applicability; it is not an exhaustive empirical proof over every nonlinear system.

Contributing and license

Contributions are welcome; see CONTRIBUTING.md. pyGDIS is distributed under the MIT License.

Metadata

Release files for pygdis 1.0.0

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

Source distribution (sdist)

Source distribution for pygdis 1.0.0
File Size Uploaded Provenance
pygdis-1.0.0.tar.gz 20.4 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 41.2 kB

Release files / pygdis-1.0.0.tar.gz

Download URL pygdis-1.0.0.tar.gz
Size 20.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6364eaf04be1575744e67b4600fd7e2b8307107bef482a58fb94fe0b73524bb3
BLAKE2b-256 checksum
How to use checksums
0f891163150813f1c00da2fb24616010060fc8d040fc9bea5ab658d3f07e6fb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / pygdis-1.0.0-py3-none-any.whl

Download URL pygdis-1.0.0-py3-none-any.whl
Size 20.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f630ddbd05be5cb4ab705871d07fa398e0a9232de37d0f1f84748da7ccd3b36e
BLAKE2b-256 checksum
How to use checksums
a245d432c656177d250315087eb36bd51e81ce5e4c0fe4901a92bf64b77cc786
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Security for pygdis 1.0.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

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