Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs-feliks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Feliks Kiszkurno
ogs-feliks
Commits
43f8b3bd
Commit
43f8b3bd
authored
6 months ago
by
Christoph Lehmann
Browse files
Options
Downloads
Patches
Plain Diff
[Py] Log summary parses vtkdiff failures, now
parent
0cc6592e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Applications/Python/ogs/dev/ogs_log_summary.py
+22
-5
22 additions, 5 deletions
Applications/Python/ogs/dev/ogs_log_summary.py
with
22 additions
and
5 deletions
Applications/Python/ogs/dev/ogs_log_summary.py
+
22
−
5
View file @
43f8b3bd
...
...
@@ -18,6 +18,9 @@ re_line_compare = re.compile(
"
Comparing data array `(?P<array_1>.+)
'
from file `(?P<file_1>.+)
'
to data array `(?P<array_2>.+)
'
from file `(?P<file_2>.+)
'
[.]
"
)
re_line_max_norm
=
re
.
compile
(
r
"
(abs|rel) maximum norm = \[([-+.,0-9e infa]+)\]
"
)
re_line_error
=
re
.
compile
(
r
"
Absolute and relative error [(]maximum norm[)] are larger than the corresponding thresholds .* and .*[.]
"
)
# A typical OGS output file name is, e.g., ramped_Neumann_BC_ts_50_t_0.625000.vtu.
# This regex matches the numerical parts of the file name including underscore
...
...
@@ -73,7 +76,7 @@ def parse_ogs_log(log_fh):
if
mode
is
None
:
if
line
.
endswith
(
"
info: ---------- vtkdiff begin ----------
"
):
mode
=
"
vtkdiff
"
vtkdiff_rec
=
{}
vtkdiff_rec
=
{
"
check_succeeded
"
:
True
}
elif
m
:
=
re_prj_file
.
search
(
line
):
prj_file
=
m
.
group
(
1
)
logger
.
debug
(
...
...
@@ -96,6 +99,8 @@ def parse_ogs_log(log_fh):
abs_or_rel
=
m
.
group
(
1
)
error_norm
=
[
float
(
comp
)
for
comp
in
m
.
group
(
2
).
split
(
"
,
"
)]
vtkdiff_rec
[
abs_or_rel
+
"
_maximum_norm
"
]
=
error_norm
elif
re_line_error
.
search
(
line
):
vtkdiff_rec
[
"
check_succeeded
"
]
=
False
if
mode
is
not
None
:
logger
.
warning
(
"
File
'
%s
'
contains an incomplete vtkdiff block.
"
,
log_fn
)
...
...
@@ -123,8 +128,13 @@ def parse_ogs_log(log_fh):
return
recs
,
prj_file
def
agg_max_by_field
(
df
):
return
df
.
groupby
(
"
array
"
).
max
()
def
agg_by_field
(
df
):
agg
=
{
col
:
"
min
"
if
col
==
"
check_succeeded
"
else
"
max
"
for
col
in
df
.
columns
if
col
!=
"
array
"
}
return
df
.
groupby
(
"
array
"
).
agg
(
agg
)
def
round_up_2_digits
(
df
):
...
...
@@ -166,8 +176,15 @@ def write_xml_snippet(df_max, xml_out_file):
for
tup
in
df_max
.
itertuples
():
file
=
Path
(
tup
.
file
).
name
file_re
=
numbers_to_regexes
(
file
)
error_msg
=
(
"""
<!-- Check failed -->
"""
if
not
tup
.
check_succeeded
else
""
)
fh
.
write
(
f
"""
f
"""
{
error_msg
}
<vtkdiff>
<regex>
{
file_re
}
</regex>
<!-- <file>
{
file
}
</file> -->
...
...
@@ -263,7 +280,7 @@ def aggregate_log_files(log_files_dirs):
for
prj_file
,
df_vtkdiff
in
map_prj_file_to_df_vtkdiff_combined
.
items
():
df_vtkdiff
=
remove_duplicate_columns
(
df_vtkdiff
)
# noqa: PLW2901
map_prj_file_to_agg_vtkdiff_stats
[
prj_file
]
=
agg_
max_
by_field
(
df_vtkdiff
)
map_prj_file_to_agg_vtkdiff_stats
[
prj_file
]
=
agg_by_field
(
df_vtkdiff
)
return
map_prj_file_to_agg_vtkdiff_stats
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment