Export all collected data to CSV files using pandas DataFrames
(self, output_dir: str = "benchmark_results")
| 206 | self.logger.debug(f"collected model measurements for benchmark #{benchmark_id}: {measurements}") |
| 207 | |
| 208 | def export_to_csv(self, output_dir: str = "benchmark_results"): |
| 209 | """ |
| 210 | Export all collected data to CSV files using pandas DataFrames |
| 211 | """ |
| 212 | if not self.collect_csv_data: |
| 213 | self.logger.warning("CSV data collection is disabled - no CSV files will be generated") |
| 214 | return |
| 215 | |
| 216 | if not os.path.exists(output_dir): |
| 217 | os.makedirs(output_dir) |
| 218 | self.logger.info(f"Created output directory: {output_dir}") |
| 219 | |
| 220 | timestamp = datetime.now().strftime("%Y%m%d_%H%M%S") |
| 221 | files_created = [] |
| 222 | |
| 223 | # Export using pandas DataFrames |
| 224 | self._export_pandas_data(output_dir, timestamp, files_created) |
| 225 | |
| 226 | self.logger.info(f"CSV export complete! Created {len(files_created)} files in {output_dir}") |
| 227 | |
| 228 | def _export_pandas_data(self, output_dir: str, timestamp: str, files_created: list): |
| 229 | """ |
no test coverage detected