quantrs2_tytan/advanced_performance_analysis/
reporting.rs1use super::*;
4
5#[derive(Debug, Clone)]
7pub struct AnalysisReport {
8 pub report_type: ReportType,
10 pub title: String,
12 pub content: ReportContent,
14 pub timestamp: Instant,
16 pub metadata: ReportMetadata,
18}
19
20#[derive(Debug, Clone, PartialEq, Eq)]
22pub enum ReportType {
23 PerformanceSummary,
24 DetailedAnalysis,
25 TrendAnalysis,
26 BenchmarkReport,
27 BottleneckAnalysis,
28 OptimizationReport,
29 ComparisonReport,
30 Custom { report_name: String },
31}
32
33#[derive(Debug, Clone)]
35pub struct ReportContent {
36 pub executive_summary: String,
38 pub key_findings: Vec<String>,
40 pub sections: Vec<ReportSection>,
42 pub visualizations: Vec<Visualization>,
44 pub appendices: Vec<Appendix>,
46}
47
48#[derive(Debug, Clone)]
50pub struct ReportSection {
51 pub title: String,
53 pub content: String,
55 pub subsections: Vec<Self>,
57 pub figures: Vec<Figure>,
59}
60
61#[derive(Debug, Clone)]
63pub struct Visualization {
64 pub viz_type: VisualizationType,
66 pub title: String,
68 pub data: VisualizationData,
70 pub config: RenderingConfig,
72}
73
74#[derive(Debug, Clone, PartialEq, Eq)]
76pub enum VisualizationType {
77 LineChart,
78 BarChart,
79 Histogram,
80 ScatterPlot,
81 BoxPlot,
82 HeatMap,
83 NetworkGraph,
84 Timeline,
85 Dashboard,
86}
87
88#[derive(Debug, Clone)]
90pub enum VisualizationData {
91 TimeSeries {
92 x: Vec<f64>,
93 y: Vec<f64>,
94 },
95 Scatter {
96 x: Vec<f64>,
97 y: Vec<f64>,
98 },
99 Histogram {
100 values: Vec<f64>,
101 bins: usize,
102 },
103 HeatMap {
104 matrix: Array2<f64>,
105 },
106 Network {
107 nodes: Vec<String>,
108 edges: Vec<(usize, usize)>,
109 },
110}
111
112#[derive(Debug, Clone)]
114pub struct RenderingConfig {
115 pub width: usize,
117 pub height: usize,
119 pub color_scheme: String,
121 pub labels: HashMap<String, String>,
123 pub style_options: HashMap<String, String>,
125}
126
127#[derive(Debug, Clone)]
129pub struct Figure {
130 pub caption: String,
132 pub data: FigureData,
134 pub position: FigurePosition,
136}
137
138#[derive(Debug, Clone)]
140pub enum FigureData {
141 Table {
142 headers: Vec<String>,
143 rows: Vec<Vec<String>>,
144 },
145 Image {
146 path: String,
147 alt_text: String,
148 },
149 Chart {
150 visualization: Visualization,
151 },
152}
153
154#[derive(Debug, Clone, PartialEq, Eq)]
156pub enum FigurePosition {
157 Here,
158 Top,
159 Bottom,
160 Page,
161 Float,
162}
163
164#[derive(Debug, Clone)]
166pub struct Appendix {
167 pub title: String,
169 pub content: AppendixContent,
171}
172
173#[derive(Debug, Clone)]
175pub enum AppendixContent {
176 RawData { data: String },
177 Code { language: String, code: String },
178 Configuration { config: String },
179 References { references: Vec<String> },
180}
181
182#[derive(Debug, Clone)]
184pub struct ReportMetadata {
185 pub author: String,
187 pub version: String,
189 pub format: ReportFormat,
191 pub tags: Vec<String>,
193 pub recipients: Vec<String>,
195}
196
197#[derive(Debug, Clone, PartialEq, Eq)]
199pub enum ReportFormat {
200 PDF,
201 HTML,
202 Markdown,
203 LaTeX,
204 JSON,
205 XML,
206}