Metadata-Version: 2.4
Name: systemictau
Version: 4.5.0
Summary: Systemic Tau and Discrete Extramental Clock (RECD) implementation
Author-email: Johel Padilla-Villanueva <joel.padilla2@upr.edu>
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24.0
Requires-Dist: scipy>=1.10.0
Requires-Dist: pandas>=2.0.0
Requires-Dist: numba>=0.57.0
Requires-Dist: scikit-learn>=1.2.0
Requires-Dist: networkx>=3.0.0
Requires-Dist: matplotlib>=3.7.0
Provides-Extra: reports
Requires-Dist: Jinja2>=3.1.0; extra == "reports"
Requires-Dist: python-docx>=1.1.0; extra == "reports"
Requires-Dist: kaleido>=0.2.1; extra == "reports"
Requires-Dist: plotly>=5.0.0; extra == "reports"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Provides-Extra: visualization
Requires-Dist: matplotlib>=3.7; extra == "visualization"
Requires-Dist: seaborn; extra == "visualization"
Provides-Extra: platform
Requires-Dist: fastapi; extra == "platform"
Requires-Dist: uvicorn; extra == "platform"
Requires-Dist: streamlit; extra == "platform"
Requires-Dist: python-multipart; extra == "platform"
Requires-Dist: pandas; extra == "platform"
Requires-Dist: xarray; extra == "platform"
Requires-Dist: folium; extra == "platform"
Requires-Dist: streamlit-folium; extra == "platform"
Requires-Dist: celery; extra == "platform"
Requires-Dist: redis; extra == "platform"
Requires-Dist: websockets; extra == "platform"
Requires-Dist: pyjwt; extra == "platform"
Requires-Dist: faust-streaming; extra == "platform"
Requires-Dist: neo4j; extra == "platform"
Requires-Dist: python-rocksdb; extra == "platform"
Requires-Dist: prometheus-client; extra == "platform"
Requires-Dist: pydantic-settings; extra == "platform"
Requires-Dist: tenacity; extra == "platform"
Requires-Dist: aiokafka; extra == "platform"
Provides-Extra: gis
Requires-Dist: geopandas; extra == "gis"
Requires-Dist: libpysal; extra == "gis"
Provides-Extra: validation
Requires-Dist: scikit-learn; extra == "validation"
Provides-Extra: performance
Requires-Dist: numba; extra == "performance"
Requires-Dist: dask; extra == "performance"
Requires-Dist: jax; extra == "performance"
Requires-Dist: jaxlib; extra == "performance"
Requires-Dist: pluggy; extra == "performance"
Provides-Extra: ai
Requires-Dist: google-genai; extra == "ai"
Requires-Dist: pydantic; extra == "ai"
Provides-Extra: desktop
Requires-Dist: customtkinter; extra == "desktop"
Provides-Extra: studio
Requires-Dist: streamlit>=1.28; extra == "studio"
Requires-Dist: matplotlib>=3.7; extra == "studio"
Requires-Dist: pandas; extra == "studio"
Requires-Dist: openpyxl; extra == "studio"
Requires-Dist: pywebview; extra == "studio"
Provides-Extra: full
Requires-Dist: matplotlib>=3.7; extra == "full"
Requires-Dist: seaborn; extra == "full"
Requires-Dist: pandas; extra == "full"
Requires-Dist: openpyxl; extra == "full"
Requires-Dist: xarray; extra == "full"
Requires-Dist: streamlit; extra == "full"
Requires-Dist: typer; extra == "full"
Requires-Dist: fastapi; extra == "full"
Requires-Dist: uvicorn; extra == "full"
Requires-Dist: python-multipart; extra == "full"
Requires-Dist: geopandas; extra == "full"
Requires-Dist: libpysal; extra == "full"
Requires-Dist: scikit-learn; extra == "full"
Requires-Dist: numba; extra == "full"
Requires-Dist: dask; extra == "full"
Requires-Dist: folium; extra == "full"
Requires-Dist: streamlit-folium; extra == "full"
Requires-Dist: google-genai; extra == "full"
Requires-Dist: celery; extra == "full"
Requires-Dist: redis; extra == "full"
Requires-Dist: websockets; extra == "full"
Requires-Dist: pyjwt; extra == "full"
Requires-Dist: jax; extra == "full"
Requires-Dist: jaxlib; extra == "full"
Requires-Dist: faust-streaming; extra == "full"
Requires-Dist: neo4j; extra == "full"
Requires-Dist: pluggy; extra == "full"
Requires-Dist: python-rocksdb; extra == "full"
Requires-Dist: prometheus-client; extra == "full"
Requires-Dist: pydantic-settings; extra == "full"
Requires-Dist: tenacity; extra == "full"
Requires-Dist: aiokafka; extra == "full"
Requires-Dist: customtkinter; extra == "full"
Requires-Dist: pywebview; extra == "full"
Dynamic: license-file

# Systemic Tau & Discrete Extramental Clock (RECD)

[![PyPI version](https://badge.fury.io/py/systemictau.svg)](https://badge.fury.io/py/systemictau)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

**`systemictau`** is a Python package implementing the mathematical and ontological framework of the **Systemic Tau paradigm** and the **Discrete Extramental Clock (RECD)**, developed by Dr. Johel Padilla-Villanueva.

This package offers a novel, non-reductive approach for time series analysis in complex systems, shifting from classical variance-based early-warning signals to purely **ordinal** observables. It proves that time is not a homogeneous container (Chronos) but an emergent, generated metric dependent on the system's own structural reorganization (Kairos).

## Core Concepts

The package operationalizes the three-layer ontological framework detailed in the *Magna Synthesis*:
1. **Capa 1 (Local Intensification):** Measures local persistence through hyper-persistence of ordinal states and structural trapping (RQA).
2. **Capa 2 (Relational Coherence):** Identifies *Joint Episodes* (relational kairoi) by measuring the anti-synchronization across modules.
3. **Capa 3 (Ontological Ascent):** Detects the exact moment of global structural reorganization through Kolmogorov-Smirnov contrasts and Frobenius norm shifts, indicating the emergence of a new law of temporal discreteness.

## Installation & Execution

The easiest way to install and run the Systemic Tau Mathematical Desktop Application is via the provided `Makefile`. This ensures all dependencies (including `customtkinter`, `scipy`, etc.) are installed perfectly.

```bash
# 1. Install the app and all its dependencies
make install

# 2. Run the desktop application
make run
```

If you prefer to install it manually using `uv` or `pip`:
```bash
uv pip install -e ".[full]"
systemictau-gui
```

## Quickstart

```python
import numpy as np
import systemictau as st

# 1. Provide your multivariate time series data
# X = np.array([...]) # Shape: (T_steps, N_components)
np.random.seed(42)
X = np.random.randn(500, 4)

# 2. Compute the Systemic Tau over sliding windows
taus_global, taus_per_module = st.compute_taus(X, window_size=13)

# 3. Accumulate the Discrete Extramental Time (RECD)
T_series, dtk_series, gate_series, depths = st.accumulate_time(taus_global)

# 4. Extract Relational Windows (Joint Episodes)
hp_z, core_hyper = st.hyper_persistence(taus_global)
lam, tt = st.rolling_rqa(taus_global)
M_series = st.critical_mass_metric(hp_z, lam, tt)

A_series = st.compute_antisynchronization(taus_per_module)
episodes = st.extract_joint_episodes(A_series, M_series)

# 5. Detect Capa 3 Reorganization (Ontological Ascent)
t_frob, max_dist = st.detect_reorganization_frob(taus_per_module)
t_ks, max_ks = st.detect_reorganization_ks(dtk_series)
t_star = st.consensus_transition(t_frob, t_ks)

print(f"Capa 3 Transition detected at t* = {t_star}")
```

## Systemic Tau Studio (Web Application)

For interactive multi-ontological analysis with publication-quality visualizations:

```bash
# Install with the studio extra (recommended)
pip install "systemictau[studio]"

# Or from source
cd /path/to/systemictau_v4
uv pip install --python .venv/bin/python ".[studio]"

# Run the app
# Note: file watcher is disabled by default via .streamlit/config.toml
# to avoid reentrant stdout / watcher errors on macOS + large projects.
PYTHONPATH=src streamlit run src/systemictau/studio/app.py

# If you want to force-disable watcher explicitly:
# PYTHONPATH=src streamlit run src/systemictau/studio/app.py --server.fileWatcherType none

# or (after proper install)
systemictau-studio
```

**Key features:**
- Upload CSV or XLSX (panel or wide format)
- Automatic or manual ontological partitioning (Local / Medium / Global)
- Systemic Tau + RECD computed consistently across scales
- High-quality plots ready for papers (PNG/SVG/PDF)
- Built-in interpretation following the Principle of Ontological Ascent
- What-if simulation of different clusterings

**Note on Excel files:** The app requires `openpyxl`. If you see an import error, run:

```bash
uv pip install --python .venv/bin/python openpyxl
```

## Citation

If you use this package in your research, please cite the foundational work:

> Padilla-Villanueva, Johel. (2026). *Síntesis Magna del Tau Sistémico*. Version v6. Zenodo. DOI: 10.5281/zenodo.20576241

For a full list of references and mathematical proofs, consult the [Zenodo Archive](https://doi.org/10.5281/zenodo.20576241).

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. The underlying theoretical corpus is published under CC-BY 4.0.
