graph_sp/
lib.rs

1//! # graph-sp
2//!
3//! A pure Rust graph executor supporting implicit node connections, branching, and config sweeps.
4//!
5//! ## Features
6//!
7//! - **Implicit Node Connections**: Nodes are automatically connected based on execution order
8//! - **Branching**: Create parallel execution paths with `.branch()`
9//! - **Config Sweeps**: Use `.variant()` to create configuration variations
10//! - **DAG Optimization**: Automatic inspection and optimization of execution paths
11//! - **Mermaid Visualization**: Generate diagrams with `to_mermaid()`
12//!
13//! ## Example
14//!
15//! ```rust
16//! use graph_sp::Graph;
17//! use std::collections::HashMap;
18//!
19//! fn data_source(_: &HashMap<String, String>) -> HashMap<String, String> {
20//!     let mut result = HashMap::new();
21//!     result.insert("output".to_string(), "Hello, World!".to_string());
22//!     result
23//! }
24//!
25//! fn processor(inputs: &HashMap<String, String>) -> HashMap<String, String> {
26//!     let mut result = HashMap::new();
27//!     if let Some(data) = inputs.get("input") {
28//!         result.insert("output".to_string(), data.to_uppercase());
29//!     }
30//!     result
31//! }
32//!
33//! let mut graph = Graph::new();
34//! graph.add(data_source, Some("Source"), None, Some(vec!["output"]));
35//! graph.add(processor, Some("Processor"), Some(vec!["input"]), Some(vec!["output"]));
36//!
37//! let dag = graph.build();
38//! ```
39
40mod builder;
41mod dag;
42mod node;
43
44#[cfg(feature = "python")]
45mod python_bindings;
46
47pub use builder::{Generator, Geomspace, Graph, IntoVariantValues, Linspace, Logspace};
48pub use dag::{Dag, ExecutionContext, ExecutionResult};
49pub use node::{NodeFunction, NodeId};