bloc.report#
Automated Calculation Note generator for Bloc.
Generates an Excel workbook (.xlsx) from simulation results, following the structure of the manual SPRING Calculation Notes. Supports multiple scenarios as side-by-side columns.
Dependencies: openpyxl
Attributes#
Functions#
|
Generate a Calculation Note Excel workbook. |
Module Contents#
- bloc.report.INPUT_SECTION_FROM_OUTPUTS#
- bloc.report.GAS_PHASE_EXCLUDE_KEYS = ['X_C(s)', 'Y_C(s)']#
- bloc.report.COMPOSITION_AGGREGATE_EXCLUDE_KEYS = ['X_PAH']#
- bloc.report.LHV_HHV_EXCEL_ERROR_KEYS#
- bloc.report.generate_calculation_note_excel(scenario_results, output_path, title='SPRING Calculation Note', subtitle='Generated by Bloc', diagram_paths=None, yaml_files=None, header_comments=None, custom_input_categories=None, custom_output_categories=None, custom_input_variable_map=None, custom_output_variable_map=None, constraints=None)#
Generate a Calculation Note Excel workbook.
- Parameters:
scenario_results (
dict) –{scenario_id: {"inputs": dict, "outputs": dict, "metadata": dict}}whereinputsare the YAML initial parameters andoutputsis theres_dicfrom the simulation.output_path (
strorPath) – Where to write the.xlsxfile.title (
str) – Title for the header.subtitle (
str) – Subtitle / description.diagram_paths (
dictorNone) –{scenario_id: {"sankey": path, "network": path}}. If provided, diagrams are embedded as images.yaml_files (
listofstrorNone) – YAML file names used for this report (shown in header).header_comments (
listofstrorNone) – Header comments extracted from the YAML file (update log, etc.).custom_input_categories (
dictorNone) – Override forbloc.yaml_utils.INPUT_CATEGORIES(e.g. tube furnace model).custom_output_categories (
dictorNone) – Override forbloc.yaml_utils.OUTPUT_CATEGORIES.custom_input_variable_map (
dictorNone) – Override forbloc.yaml_utils.INPUT_VARIABLE_MAP.custom_output_variable_map (
dictorNone) – Override forbloc.yaml_utils.OUTPUT_VARIABLE_MAP.constraints (
listofbloc.constraints.ConstraintorNone) – Design constraints evaluated against each scenario’s outputs. When provided, a DESIGN CONSTRAINTS section is added to the summary sheet with red-background cells for violated constraints.
- Returns:
The path to the generated file.
- Return type:
Path