Skip to content
Snippets Groups Projects
Commit c6dad9ff authored by Maurice Zimmnau's avatar Maurice Zimmnau
Browse files

Added helper script to evaluate the design evaluator results

parent f0888754
No related branches found
No related tags found
No related merge requests found
Pipeline #1626300 failed
import argparse
import pandas as pd
from bs4 import BeautifulSoup
import numpy as np
from io import StringIO
import sys
def check_html_file(html_file):
# Load and parse the HTML file with BeautifulSoup
with open(html_file, 'r') as file:
soup = BeautifulSoup(file, 'lxml')
# Find all tables in the HTML file (in case there are multiple)
tables = soup.find_all('table')
# Select the first table (assuming there's only one)
table = tables[0]
table = str(table)
# Convert the HTML table to a Pandas DataFrame
df = pd.read_html(StringIO(table))[0]
# Check the values in the fourth column (index 3)
has_deviation = False
for index, value in enumerate(df.iloc[:, 3]):
if not pd.isna(value) and value not in ['-nan', 'nan', 0]:
first_column_value = df.iloc[index, 0] # Get the first column value of this row
print(f"Warning: Deviation in '{first_column_value}'.")
print(f"Deviation between server version and calculation with feature: '{value}'")
has_deviation = True
if has_deviation:
sys.exit(2)
def main():
parser = argparse.ArgumentParser(
description='Check an HTML file for invalid values in the fourth column.'
)
parser.add_argument('--file', type=str, help='Path to the HTML file')
args = parser.parse_args()
check_html_file(args.file)
if __name__ == "__main__":
main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment