Python bindings for DDA (Delay Differential Analysis)
Project description
dda-py
Python bindings for DDA (Delay Differential Analysis).
The DDA binary is required. Please download the most recent version from the file server.
Installation
pip install dda-py
Usage
Basic Example
from dda_py import DDARequest, DDARunner
# Initialize the runner with path to DDA binary
runner = DDARunner(binary_path="run_DDA_AsciiEdf")
# Create an analysis request
request = DDARequest(
file_path="patient1_S05__01_03.edf",
channels=[1, 2, 3], # 0-based channel indices
variants=["ST", "SY"], # Which DDA variants to run
window_length=2048,
window_step=1024,
delays=[7, 10], # Delay values for -TAU flag
)
# Execute DDA analysis
results = runner.run(request)
# Access results for each variant
for variant_name, variant_results in results.items():
print(f"\n{variant_name} Results:")
print(f" Matrix shape: {variant_results['num_channels']} × {variant_results['num_timepoints']}")
print(f" Stride: {variant_results['stride']}")
# Access the actual data
channels = variant_results["channels"]
print(f" Data: {len(channels)} channels with {len(channels[0]['timepoints'])} timepoints each")
Advanced Options
# Full configuration example with all optional parameters
request = DDARequest(
file_path="patient1_S05__01_03.edf",
channels=[1, 2, 3],
variants=["ST", "CT", "SY"],
window_length=2048,
window_step=1024,
delays=[7, 10],
model_params=[1, 2, 10], # DDA model encoding for -MODEL flag
# Optional parameters:
ct_window_length=2, # Required for CT/CD/DE variants
ct_window_step=2,
polynomial_order=4,
num_tau=2,
)
Working with Variant Metadata
from dda_py import get_variant_by_abbrev, generate_select_mask, parse_select_mask
# Get information about a variant
st_variant = get_variant_by_abbrev("ST")
print(f"Name: {st_variant.name}")
print(f"Documentation: {st_variant.documentation}")
print(f"Stride: {st_variant.stride}")
# Generate SELECT masks for multiple variants
mask = generate_select_mask(["ST", "CT", "SY"])
print(f"SELECT mask: {mask}")
# Parse a mask to see which variants are enabled
enabled = parse_select_mask(mask)
print(f"Enabled variants: {enabled}")
Variants
The package provides access to all DDA variants:
ST- Single TimeseriesCT- Cross TimeseriesCD- Cross DynamicalDE- Dynamical ErgodicitySY- Synchrony
License
MIT
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
dda_py-0.2.7.tar.gz
(31.2 MB
view details)
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
dda_py-0.2.7-py3-none-any.whl
(21.8 kB
view details)
File details
Details for the file dda_py-0.2.7.tar.gz.
File metadata
- Download URL: dda_py-0.2.7.tar.gz
- Upload date:
- Size: 31.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b543b508ee9478ccef63c99efcb5c10e5e50ec1b54dcb28f0aff25e8c1921343
|
|
| MD5 |
aeaee2d0461ae6e25fa98822d638c835
|
|
| BLAKE2b-256 |
ae97126446e834f7790313ac4baf8e40b2af6a42d54b8c5fbd753ccb62a96976
|
File details
Details for the file dda_py-0.2.7-py3-none-any.whl.
File metadata
- Download URL: dda_py-0.2.7-py3-none-any.whl
- Upload date:
- Size: 21.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d7bcbd17c067c667c5b3e499e0df183de376d794a633039efcb53d94bcaae2a
|
|
| MD5 |
a646aa7153368af623c4cdee862684a6
|
|
| BLAKE2b-256 |
0b068c7b3856674370f43c86f12204546585becd12451ef87ef5166b50eb4b27
|