Skip to content

Commit e5c081e

Browse files
committed
Refactor test result parsing: move to test_parser.py and remove charts_utils.py
1 parent 72a7959 commit e5c081e

4 files changed

Lines changed: 6 additions & 14 deletions

File tree

Sources/EasyExtensions.Crypto.Tests.Charts/advanced_analysis.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
import re
21
import matplotlib.pyplot as plt
32
import pandas as pd
43
import numpy as np
54
import seaborn as sns
6-
from charts_utils import parse_test_results
7-
5+
from test_parser import parse_test_results
86

97

108
def create_advanced_plots(encrypt_data, decrypt_data):

Sources/EasyExtensions.Crypto.Tests.Charts/mega_advanced_analysis.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
import re
21
import matplotlib.pyplot as plt
32
import pandas as pd
43
import numpy as np
54
import seaborn as sns
65
from matplotlib.patches import Rectangle
76
import matplotlib.gridspec as gridspec
8-
from charts_utils import parse_test_results
9-
7+
from test_parser import parse_test_results
108

119

1210
def create_mega_analysis(encrypt_data, decrypt_data):

Sources/EasyExtensions.Crypto.Tests.Charts/simple_charts.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import re
21
import matplotlib.pyplot as plt
32
import pandas as pd
43
import numpy as np
5-
from charts_utils import parse_test_results
6-
4+
from test_parser import parse_test_results
75

86

97
def create_plots(encrypt_data, decrypt_data):

Sources/EasyExtensions.Crypto.Tests.Charts/charts_utils.py renamed to Sources/EasyExtensions.Crypto.Tests.Charts/test_parser.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33

44

55
def parse_test_results(filename):
6-
"""Parse performance test results from a file.
7-
8-
Returns a tuple (encrypt_data, decrypt_data) as pandas DataFrames.
9-
"""
6+
"""Parse performance test results from a file"""
107

118
with open(filename, 'r', encoding='utf-8') as f:
129
content = f.read()
@@ -22,6 +19,7 @@ def extract_data(section_text):
2219
if not section_text:
2320
return pd.DataFrame()
2421

22+
# Ищем строки с данными (формат: число | число | число.число)
2523
pattern = r'(\d+)\s*\|\s*(\d+)\s*\|\s*([\d.]+)'
2624
matches = re.findall(pattern, section_text)
2725

@@ -31,7 +29,7 @@ def extract_data(section_text):
3129
chunk_mb = int(match[1])
3230
throughput = float(match[2])
3331
data.append({'Threads': threads, 'ChunkMB': chunk_mb,
34-
'Throughput': throughput})
32+
'Throughput': throughput})
3533

3634
return pd.DataFrame(data)
3735

0 commit comments

Comments
 (0)