From c5e90757aaafd75188123eb7ce06ad7a92738957 Mon Sep 17 00:00:00 2001 From: AndiGob <andreas.gobbbin@hotmail.de> Date: Thu, 27 Feb 2025 10:36:35 +0100 Subject: [PATCH 1/5] cost_estimation: - add tool version to html report --- cost_estimation/cost_estimation.py | 3 ++- cost_estimation/src/datapreprocessing.py | 3 ++- .../general/methodhtmlreport.py | 8 +++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/cost_estimation/cost_estimation.py b/cost_estimation/cost_estimation.py index 4cd8c941..e451c411 100644 --- a/cost_estimation/cost_estimation.py +++ b/cost_estimation/cost_estimation.py @@ -51,12 +51,13 @@ def main(): # Initialize exception string and runtime output logger. tool_name = 'cost estimation' + tool_version = '0.5.0' runtime_output = logging.getLogger('module_logger') try: """Preprocessing: Acquire necessary data and paths.""" # Run 'data_preprocessing' function from 'datapreprocessing.py'. - paths_and_names, routing_dict, runtime_output = data_preprocessing("cost_estimation_conf.xml", argv) + paths_and_names, routing_dict, runtime_output = data_preprocessing("cost_estimation_conf.xml", tool_version, argv) runtime_output.print("Cost estimation started...") """Run: Execute code depending on method layers.""" diff --git a/cost_estimation/src/datapreprocessing.py b/cost_estimation/src/datapreprocessing.py index a1399f07..d918b2c9 100644 --- a/cost_estimation/src/datapreprocessing.py +++ b/cost_estimation/src/datapreprocessing.py @@ -28,7 +28,7 @@ from datapreprocessingmodule import get_paths_and_names, read_routing_values_fro from src.readlayertext import read_energy_carrier -def data_preprocessing(module_configuration_file, argv): +def data_preprocessing(module_configuration_file, tool_version, argv): """Conduct data preprocessing. This function provides data preprocessing functionalities. It sets up the necessary data and imports relevant @@ -61,6 +61,7 @@ def data_preprocessing(module_configuration_file, argv): """Get paths, names, and xml trees for module configuration and aircraft exchange file.""" # Call 'get_paths_and_names' function to obtain various paths and names. paths_and_names, runtime_output = get_paths_and_names(module_configuration_file, argv) + paths_and_names['tool_version'] = tool_version # Note: It is the exclusive responsibility of the module manager to modify the following information! # Create layer description dictionary according to the number of individual layers. The dictionary associates # layers with their respective XML paths and expected data types according to the following scheme: diff --git a/cost_estimation/src/tube_and_wing/empirical/operating_cost_estimation_tu_berlin/general/methodhtmlreport.py b/cost_estimation/src/tube_and_wing/empirical/operating_cost_estimation_tu_berlin/general/methodhtmlreport.py index 3333e122..46efc077 100644 --- a/cost_estimation/src/tube_and_wing/empirical/operating_cost_estimation_tu_berlin/general/methodhtmlreport.py +++ b/cost_estimation/src/tube_and_wing/empirical/operating_cost_estimation_tu_berlin/general/methodhtmlreport.py @@ -40,6 +40,7 @@ def method_html_report(paths_and_names, routing_dict, data_dict, method_specific """ Preparation.""" # Extract tool and project name. tool_name = paths_and_names['tool_name'] + tool_version = paths_and_names['tool_version'] report_title = (tool_name.replace('_', ' ')).capitalize() project_name = paths_and_names['name_of_project'] root_of_module_config_tree = paths_and_names['root_of_module_config_tree'] @@ -151,8 +152,13 @@ def method_html_report(paths_and_names, routing_dict, data_dict, method_specific with tag('div', klass="content"): with tag('h1'): text(f"Report - {report_title} of {project_name}") + with tag('br'): # Line break for formatting + pass + with tag('span'): + with tag('font', size="2"): + text(f"All outputs of the program '{tool_name}' were created with version {tool_version}") + with tag('div', klass="container"): - # Data on the left side. with tag('div', klass="box data"): # Add small description. -- GitLab From 509cff084b8088c23b40dfce3ba3424acd248d29 Mon Sep 17 00:00:00 2001 From: AndiGob <andreas.gobbbin@hotmail.de> Date: Thu, 27 Feb 2025 10:46:07 +0100 Subject: [PATCH 2/5] fuselage_design: - add tool verion to html report --- fuselage_design/fuselage_design.py | 3 ++- fuselage_design/src/datapreprocessing.py | 3 ++- .../general/methodhtmlreport.py | 18 +++++++++--------- .../general/methodplot.py | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/fuselage_design/fuselage_design.py b/fuselage_design/fuselage_design.py index 88d27d3d..6f8b2b67 100644 --- a/fuselage_design/fuselage_design.py +++ b/fuselage_design/fuselage_design.py @@ -50,12 +50,13 @@ def main(): # Initialize exception string and runtime output logger. tool_name = 'fuselage design' + tool_version = '0.5.0' runtime_output = logging.getLogger('module_logger') try: """Preprocessing: Acquire necessary data and paths.""" # Run 'data_preprocessing' function from 'datapreprocessing.py'. - paths_and_names, routing_dict, runtime_output = data_preprocessing('fuselage_design_conf.xml', argv) + paths_and_names, routing_dict, runtime_output = data_preprocessing('fuselage_design_conf.xml', tool_version, argv) runtime_output.print('Fuselage design started...') """Run: Execute code depending on method layers.""" diff --git a/fuselage_design/src/datapreprocessing.py b/fuselage_design/src/datapreprocessing.py index f260413c..b19466a9 100644 --- a/fuselage_design/src/datapreprocessing.py +++ b/fuselage_design/src/datapreprocessing.py @@ -29,7 +29,7 @@ from datapreprocessingmodule import get_paths_and_names from datapreprocessingmodule import read_routing_values_from_xml -def data_preprocessing(module_configuration_file, argv): +def data_preprocessing(module_configuration_file, tool_version, argv): """Conduct data preprocessing. This function provides data preprocessing functionalities. It sets up the necessary data and imports @@ -60,6 +60,7 @@ def data_preprocessing(module_configuration_file, argv): """Get paths, names, and xml trees for module configuration and aircraft exchange file.""" # Call 'get_paths_and_names' function to obtain various paths and names. paths_and_names, runtime_output = get_paths_and_names(module_configuration_file, argv) + paths_and_names['tool_version'] = tool_version # Note: It is the exclusive responsibility of the module manager to modify the following information! # Create layer description dictionary according to the number of individual layers. The dictionary associates # layers with their respective XML paths and expected data types according to the following scheme: diff --git a/fuselage_design/src/tube_and_wing/empirical/fuselage_design_tu_berlin/general/methodhtmlreport.py b/fuselage_design/src/tube_and_wing/empirical/fuselage_design_tu_berlin/general/methodhtmlreport.py index 92835ef9..33fd241b 100644 --- a/fuselage_design/src/tube_and_wing/empirical/fuselage_design_tu_berlin/general/methodhtmlreport.py +++ b/fuselage_design/src/tube_and_wing/empirical/fuselage_design_tu_berlin/general/methodhtmlreport.py @@ -40,6 +40,7 @@ def method_html_report(paths_and_names, routing_dict, data_dict, method_specific """ Preparation and data extraction.""" # Extract tool and project name. tool_name = paths_and_names['tool_name'] + tool_version = paths_and_names['tool_version'] report_title = (tool_name.replace('_', ' ')).capitalize() project_name = paths_and_names['name_of_project'] root_of_module_config_tree = paths_and_names['root_of_module_config_tree'] @@ -208,8 +209,13 @@ def method_html_report(paths_and_names, routing_dict, data_dict, method_specific with tag('div', klass="content"): with tag('h1'): text(f"Report - {report_title} of {project_name}") + with tag('br'): # Line break for formatting + pass + with tag('span'): + with tag('font', size="2"): + text(f"All outputs of the program '{tool_name}' were created with version {tool_version}") + with tag('div', klass="container"): - # Data on the left side. with tag('div', klass="box data"): @@ -270,14 +276,8 @@ def method_html_report(paths_and_names, routing_dict, data_dict, method_specific text("Plots") # 3D shape. with tag('h3'): - text('Fuselage 3D shape') - src_name = "../plots/fuselage_design_3D_shape.svg" - with tag('img',src=src_name, klass="image-plot", style="margin-bottom: 20px;"): - pass - # 3D shape. - with tag('h3'): - text('Fuselage isometric view') - src_name = "../plots/fuselage_design_Isometric view of fuselage shape.svg" + text('Fuselage side view') + src_name = "../plots/fuselage_design_side view of fuselage.svg" with tag('img',src=src_name, klass="image-plot", style="margin-bottom: 20px;"): pass diff --git a/fuselage_design/src/tube_and_wing/empirical/fuselage_design_tu_berlin/general/methodplot.py b/fuselage_design/src/tube_and_wing/empirical/fuselage_design_tu_berlin/general/methodplot.py index b66f7f0e..7f91be6f 100644 --- a/fuselage_design/src/tube_and_wing/empirical/fuselage_design_tu_berlin/general/methodplot.py +++ b/fuselage_design/src/tube_and_wing/empirical/fuselage_design_tu_berlin/general/methodplot.py @@ -70,7 +70,7 @@ def create_fuselage_3d_plot(paths_and_names, data_dict, plot_directory, runtime_ """ ''' Plot of front view ''' # Generate figure. - plot_title = 'Isometric view of fuselage shape' + plot_title = 'Side view of fuselage' fig = plt.figure(figsize=(12, 7.5)) ax = fig.add_subplot(111, projection='3d') -- GitLab From 2e56cd657078e4e2a1e6b297fadf34cd0453ec80 Mon Sep 17 00:00:00 2001 From: AndiGob <andreas.gobbbin@hotmail.de> Date: Thu, 27 Feb 2025 10:49:35 +0100 Subject: [PATCH 3/5] tank_design: - add tool version to html report --- tank_design/src/datapreprocessing.py | 5 +++-- .../tank_design_tu_berlin/general/methodhtmlreport.py | 8 +++++++- tank_design/tank_design.py | 3 ++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tank_design/src/datapreprocessing.py b/tank_design/src/datapreprocessing.py index 04055070..38882742 100644 --- a/tank_design/src/datapreprocessing.py +++ b/tank_design/src/datapreprocessing.py @@ -28,7 +28,7 @@ from datapreprocessingmodule import get_paths_and_names, read_routing_values_fro from src.readlayertext import read_energy_carrier -def data_preprocessing(module_configuration_file, argv): +def data_preprocessing(module_configuration_file, tool_version, argv): """Conduct data preprocessing. This function provides data preprocessing functionalities. It sets up the necessary data and imports relevant @@ -61,7 +61,8 @@ def data_preprocessing(module_configuration_file, argv): """Get paths, names, and xml trees for module configuration and aircraft exchange file.""" # Call 'get_paths_and_names' function to obtain various paths and names. paths_and_names, runtime_output = get_paths_and_names(module_configuration_file, argv) - + paths_and_names['tool_version'] = tool_version + """ Extract data from aircraft exchange and module configuration file.""" # Extract root and path to aircraft exchange file and write key data to aircraft exchange file. root_of_aircraft_exchange_tree = paths_and_names['root_of_aircraft_exchange_tree'] diff --git a/tank_design/src/tube_and_wing/empirical/tank_design_tu_berlin/general/methodhtmlreport.py b/tank_design/src/tube_and_wing/empirical/tank_design_tu_berlin/general/methodhtmlreport.py index e1c96f41..a4f8daaf 100644 --- a/tank_design/src/tube_and_wing/empirical/tank_design_tu_berlin/general/methodhtmlreport.py +++ b/tank_design/src/tube_and_wing/empirical/tank_design_tu_berlin/general/methodhtmlreport.py @@ -40,6 +40,7 @@ def method_html_report(paths_and_names, routing_dict, data_dict, method_specific """ Preparation.""" # Extract tool and project name. tool_name = paths_and_names['tool_name'] + tool_version = paths_and_names['tool_version'] report_title = (tool_name.replace('_', ' ')).capitalize() project_name = paths_and_names['name_of_project'] root_of_module_config_tree = paths_and_names['root_of_module_config_tree'] @@ -106,8 +107,13 @@ def method_html_report(paths_and_names, routing_dict, data_dict, method_specific with tag('div', klass="content"): with tag('h1'): text(f"Report - {report_title} of {project_name}") + with tag('br'): # Line break for formatting + pass + with tag('span'): + with tag('font', size="2"): + text(f"All outputs of the program '{tool_name}' were created with version {tool_version}") + with tag('div', klass="container"): - # Data on the left side. with tag('div', klass="box data"): with tag('h2'): diff --git a/tank_design/tank_design.py b/tank_design/tank_design.py index 5d3ec416..3b652ebd 100644 --- a/tank_design/tank_design.py +++ b/tank_design/tank_design.py @@ -51,12 +51,13 @@ def main(): # Initialize exception string and runtime output logger. tool_name = 'tank design' + tool_version = '0.5.0' runtime_output = logging.getLogger('module_logger') try: """Preprocessing: Acquire necessary data and paths.""" # Run 'data_preprocessing' function from 'datapreprocessing.py'. - paths_and_names, routing_dict, runtime_output = data_preprocessing('tank_design_conf.xml', argv) + paths_and_names, routing_dict, runtime_output = data_preprocessing('tank_design_conf.xml', tool_version, argv) runtime_output.print('Tank design started...') """Run: Execute code depending on method layers.""" -- GitLab From ce83c49bb3ba32376ed7b3d78654f7edf4a4c848 Mon Sep 17 00:00:00 2001 From: AndiGob <andreas.gobbbin@hotmail.de> Date: Thu, 27 Feb 2025 10:57:34 +0100 Subject: [PATCH 4/5] weight_and_balance_analysis: - add tool version to html report --- libs | 2 +- weight_and_balance_analysis/src/datapreprocessing.py | 4 +++- weight_and_balance_analysis/weight_and_balance_analysis.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libs b/libs index 47e224dd..89f0b30f 160000 --- a/libs +++ b/libs @@ -1 +1 @@ -Subproject commit 47e224dd8c3e17185ff61f0916a7a637a72125c5 +Subproject commit 89f0b30f7835b7be4b8edef43d9eb2c1764cb6d0 diff --git a/weight_and_balance_analysis/src/datapreprocessing.py b/weight_and_balance_analysis/src/datapreprocessing.py index 05da58a9..afbf9f11 100644 --- a/weight_and_balance_analysis/src/datapreprocessing.py +++ b/weight_and_balance_analysis/src/datapreprocessing.py @@ -27,7 +27,7 @@ import sys from datapreprocessingmodule import get_paths_and_names, read_routing_values_from_xml -def data_preprocessing(module_configuration_file, argv): +def data_preprocessing(module_configuration_file, tool_version, argv): """Conduct data preprocessing. This function provides data preprocessing functionalities. It sets up the necessary data and imports @@ -55,6 +55,8 @@ def data_preprocessing(module_configuration_file, argv): # Call 'get_paths_and_names' function to obtain various paths and names. paths_and_names, runtime_output = get_paths_and_names( module_configuration_file, argv) + paths_and_names['tool_version'] = tool_version + # Note: It is the exclusive responsibility of the module manager to modify the following information! # Create layer description dictionary according to the number of individual layers. # The dictionary associates layers with their respective XML paths and expected data types according to the diff --git a/weight_and_balance_analysis/weight_and_balance_analysis.py b/weight_and_balance_analysis/weight_and_balance_analysis.py index 917b0643..aebca851 100644 --- a/weight_and_balance_analysis/weight_and_balance_analysis.py +++ b/weight_and_balance_analysis/weight_and_balance_analysis.py @@ -65,12 +65,13 @@ def main(): # Initialize exception string and runtime output logger. runtime_output = logging.getLogger('module_logger') tool_name = "Weight and Balance" + tool_version = '0.5.0' try: """Preprocessing: Acquire necessary data and paths.""" # Run 'data_preprocessing' function from 'datapreprocessing.py'. paths_and_names, routing_dict, runtime_output = data_preprocessing( - module_config_file, argv) + module_config_file, tool_version, argv) runtime_output.print(f'{module_name} started...') """Run: Execute code depending on method layers.""" -- GitLab From e236bd99665b92ef012c602de708da9335d2741f Mon Sep 17 00:00:00 2001 From: AndiGob <andreas.gobbbin@hotmail.de> Date: Thu, 27 Feb 2025 10:58:24 +0100 Subject: [PATCH 5/5] weight_and_balance_analysis: - add tool version to html report --- .../src/tube_and_wing/standard/general/methodhtmlreport.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/weight_and_balance_analysis/src/tube_and_wing/standard/general/methodhtmlreport.py b/weight_and_balance_analysis/src/tube_and_wing/standard/general/methodhtmlreport.py index 2fa87b68..7a2e0152 100644 --- a/weight_and_balance_analysis/src/tube_and_wing/standard/general/methodhtmlreport.py +++ b/weight_and_balance_analysis/src/tube_and_wing/standard/general/methodhtmlreport.py @@ -38,6 +38,7 @@ def method_html_report(paths_and_names, routing_dict, data_dict, method_specific # This is just a dummy code snippet. Insert your code here. tool_name = paths_and_names['tool_name'] + tool_version = paths_and_names['tool_version'] report_title = camelcase_to_string(tool_name) project_name = paths_and_names['name_of_project'] @@ -142,6 +143,12 @@ def method_html_report(paths_and_names, routing_dict, data_dict, method_specific with tag('div', klass="content"): with tag('h1'): text(f"Report - {report_title} of {project_name}") + with tag('br'): # Line break for formatting + pass + with tag('span'): + with tag('font', size="2"): + text(f"All outputs of the program '{tool_name}' were created with version {tool_version}") + with tag('div', klass="container"): with tag('div', klass="box data"): with tag('h2'): -- GitLab