dda-rs
Rust library for Delay Differential Analysis (DDA). Provides a type-safe interface to execute the run_DDA_AsciiEdf binary and parse its output.
The DDA binary is required. Please download the most recent version from the file server.
Features
- Type-safe API: Strongly-typed request/response structures with serde support
- Spec-generated variants: Variant metadata auto-generated from the canonical DDA spec
- Cross-platform: Handles APE binary execution on Unix (sh wrapper) and Windows
- Async execution: Built on Tokio for non-blocking DDA analysis
- Binary resolution: Automatic discovery of the DDA binary via env vars and standard paths
- Output parsing: Processes raw DDA output into Q matrices
Installation
[]
= "0.1.4"
= { = "1", = ["rt-multi-thread", "macros"] }
Quick Start
use ;
async
Variant Metadata
The crate includes spec-generated variant metadata for all DDA analysis types:
| Variant | Position | Stride | Channel Format | Description |
|---|---|---|---|---|
| ST | 0 | 4 | Individual | Single Timeseries - analyzes channels independently |
| CT | 1 | 4 | Pairs | Cross-Timeseries - symmetric channel pair relationships |
| CD | 2 | 2 | Directed Pairs | Cross-Dynamical - directed causal relationships |
| RESERVED | 3 | 1 | - | Internal (always 0 in production) |
| DE | 4 | 1 | Individual | Delay Embedding - ergodic behavior testing |
| SY | 5 | 1 | Individual | Synchronization - synchronized behavior detection |
use ;
// Access variant metadata
println!; // 4
println!; // ["-WL_CT", "-WS_CT"]
// Look up by abbreviation
let variant = from_abbrev.unwrap;
println!;
Binary Resolution
The DDA binary is resolved in this order:
- Explicit path passed to
DDARunner::new() $DDA_BINARY_PATHenvironment variable$DDA_HOME/bin/run_DDA_AsciiEdf- Default paths:
~/.local/bin,~/bin,/usr/local/bin,/opt/dda/bin
use ;
// Find binary (returns Option)
if let Some = find_binary
// Require binary (returns Result)
let path = require_binary?;
Modules
| Module | Description |
|---|---|
variants |
Spec-generated variant metadata, SELECT mask utilities |
types |
Request/response structures (DDARequest, DDAResult) |
runner |
DDA binary execution logic |
parser |
Output file parsing and Q matrix transformation |
error |
Error types (DDAError) and Result alias |
network_motifs |
Network motif analysis utilities |
profiling |
Performance profiling helpers |
Code Generation
The variants module is auto-generated from the canonical DDA specification. Do not edit it manually. To regenerate:
License
MIT