Skip to content

Commit ff3f103

Browse files
committed
wip
1 parent 965f6a0 commit ff3f103

18 files changed

+104
-1105
lines changed

src/analysis/mod.rs

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -8,79 +8,6 @@
88
99
#[cfg(feature = "plotting")]
1010
pub mod plotting;
11-
pub mod reporting;
12-
pub mod statistics;
13-
14-
// Re-export commonly used types
15-
16-
use crate::benchmarks::evaluation::BenchmarkResults;
17-
use crate::optimizers::OptResult;
18-
#[cfg(feature = "plotting")]
19-
pub use plotting::{ExtendedOptimizationTrace, PlotConfig, PlottingEngine};
20-
pub use reporting::{AcademicReport, CSVExporter, LaTeXExporter};
21-
pub use statistics::{
22-
ConvergenceComparison, EffectSize, PerformanceProfiles, RobustnessAnalysis, SignificanceTest,
23-
StatisticalAnalysis,
24-
};
25-
26-
/// Generate comprehensive analysis report
27-
pub fn generate_full_analysis(results: &BenchmarkResults) -> OptResult<AnalysisReport> {
28-
let stats = StatisticalAnalysis::new(results);
29-
let convergence = stats.convergence_comparison().clone();
30-
let performance = stats.performance_profiles().clone();
31-
let robustness = stats.robustness_analysis().clone();
32-
33-
Ok(AnalysisReport {
34-
convergence_comparison: convergence,
35-
performance_profiles: performance,
36-
robustness_analysis: robustness,
37-
statistical_tests: stats.significance_tests().clone(),
38-
effect_sizes: stats.effect_sizes(),
39-
})
40-
}
41-
42-
/// Complete analysis report structure
43-
#[derive(Debug, Clone)]
44-
pub struct AnalysisReport {
45-
pub convergence_comparison: ConvergenceComparison,
46-
pub performance_profiles: PerformanceProfiles,
47-
pub robustness_analysis: RobustnessAnalysis,
48-
pub statistical_tests: Vec<SignificanceTest>,
49-
pub effect_sizes: Vec<EffectSize>,
50-
}
51-
52-
impl AnalysisReport {
53-
/// Export to LaTeX format for academic papers
54-
pub fn to_latex(&self) -> OptResult<String> {
55-
let exporter = LaTeXExporter::new();
56-
exporter.export_report(self)
57-
}
58-
59-
/// Export to CSV for further analysis
60-
pub fn to_csv(&self, output_dir: &std::path::Path) -> OptResult<()> {
61-
let exporter = CSVExporter::new();
62-
exporter.export_report(self, output_dir)
63-
}
64-
65-
/// Generate summary statistics
66-
pub fn summary(&self) -> String {
67-
format!(
68-
"Analysis Summary:\n\
69-
- Problems analyzed: {}\n\
70-
- Optimizers compared: {}\n\
71-
- Significant improvements: {}\n\
72-
- Average effect size: {:.3}",
73-
self.convergence_comparison.num_problems(),
74-
self.convergence_comparison.num_optimizers(),
75-
self.statistical_tests
76-
.iter()
77-
.filter(|t| t.is_significant())
78-
.count(),
79-
self.effect_sizes.iter().map(|e| e.magnitude()).sum::<f64>()
80-
/ self.effect_sizes.len() as f64
81-
)
82-
}
83-
}
8411

8512
#[cfg(test)]
8613
mod tests {

src/analysis/plotting.rs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -398,16 +398,19 @@ impl PlottingEngine {
398398
);
399399
// Use slightly different line styles for multiple runs of the same optimizer
400400
let line_style = if run_idx == 0 {
401-
(*color).to_rgba()
401+
(*color).to_rgba()
402402
} else {
403403
// Make subsequent runs more transparent based on run index
404-
(*color).mix(0.8 - (run_idx as f64 * 0.05).min(0.3)).to_rgba()
404+
(*color)
405+
.mix(0.8 - (run_idx as f64 * 0.05).min(0.3))
406+
.to_rgba()
405407
};
406408

407409
// Draw series
408410
chart
409411
.draw_series(LineSeries::new(series_data.clone(), &line_style))
410412
.map_err(|e| anyhow::anyhow!("Series drawing error: {}", e))?;
413+
411414
// Add markers at regular intervals for better visibility
412415
let marker_interval = series_data.len().max(1) / 20 + 1;
413416
debug!("Adding markers every {} points", marker_interval);
@@ -637,12 +640,19 @@ impl PlottingEngine {
637640
);
638641
// Use slightly different line styles for multiple runs of the same optimizer
639642
let line_style = if run_idx == 0 {
640-
(*color).to_rgba()
643+
(*color).to_rgba()
641644
} else {
642-
// Make subsequent runs slightly more transparent
643-
(*color).mix(0.7).to_rgba()
645+
// Make subsequent runs more transparent based on run index
646+
(*color)
647+
.mix(0.8 - (run_idx as f64 * 0.05).min(0.3))
648+
.to_rgba()
644649
};
645650

651+
// Draw series
652+
chart
653+
.draw_series(LineSeries::new(series_data.clone(), &line_style))
654+
.map_err(|e| anyhow::anyhow!("Series drawing error: {}", e))?;
655+
646656
// Add markers for better visibility
647657
let marker_interval = series_data.len().max(1) / 20 + 1;
648658
debug!("Adding log markers every {} points", marker_interval);
@@ -1502,4 +1512,4 @@ mod tests {
15021512
assert!(data.q1 < data.median);
15031513
assert!(data.median < data.q3);
15041514
}
1505-
}
1515+
}

src/analysis/reporting.rs

Lines changed: 0 additions & 78 deletions
This file was deleted.

0 commit comments

Comments
 (0)