Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
dumux-repositories
dumux
Commits
f1f433ca
Commit
f1f433ca
authored
2 years ago
by
Dennis Gläser
Committed by
Timo Koch
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[bin][runtest] read file types explicitly
parent
dc11d8d4
No related branches found
No related tags found
1 merge request
!3353
Feature/fieldcompare
Pipeline
#25966
passed
2 years ago
Stage: check-status
Stage: trigger dumux pipelines
+2
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/testing/runtest.py
+5
-22
5 additions, 22 deletions
bin/testing/runtest.py
with
5 additions
and
22 deletions
bin/testing/runtest.py
+
5
−
22
View file @
f1f433ca
...
...
@@ -14,15 +14,10 @@ import json
try
:
import
fieldcompare.mesh
as
meshcompare
import
fieldcompare.tabular
as
tabularcompare
from
fieldcompare
import
FieldDataComparator
,
protocols
,
DefaultFieldComparisonCallback
from
fieldcompare.mesh
import
MeshFieldsComparator
from
fieldcompare.predicates
import
DefaultEquality
,
ScaledTolerance
from
fieldcompare.io
import
CSVFieldReader
,
read
protocols
.
MeshFields
=
meshcompare
.
MeshFields
protocols
.
TabularFields
=
tabularcompare
.
TabularFields
from
fieldcompare.io
import
read_as
# pylint: disable=too-many-arguments
def
makePredicateSelector
(
...
...
@@ -60,14 +55,8 @@ try:
print
(
f
"
-- Using the following absolute thresholds:
{
zeroValueThreshold
}
"
)
# read the files
sourceFields
=
read
(
source
)
referenceFields
=
read
(
ref
)
# some type checking to be sure we are comparing meshes
if
not
isinstance
(
sourceFields
,
protocols
.
MeshFields
):
raise
IOError
(
"
Source file could not been identified as mesh file!
"
)
if
not
isinstance
(
referenceFields
,
protocols
.
MeshFields
):
raise
IOError
(
"
Reference file could not been identified as mesh file!
"
)
sourceFields
=
read_as
(
"
mesh
"
,
source
)
referenceFields
=
read_as
(
"
mesh
"
,
ref
)
# hard-code some values for the mesh comparisons (as for Dumux legacy backend)
sourceFields
.
domain
.
set_tolerances
(
abs_tol
=
ScaledTolerance
(
1e-6
),
rel_tol
=
1.5e-7
)
...
...
@@ -112,14 +101,8 @@ try:
if
zeroValueThreshold
:
print
(
f
"
-- Using the following absolute thresholds:
{
zeroValueThreshold
}
"
)
sourceFields
=
CSVFieldReader
(
delimiter
=
delimiter
,
use_names
=
False
).
read
(
source
)
referenceFields
=
CSVFieldReader
(
delimiter
=
delimiter
,
use_names
=
False
).
read
(
ref
)
# some type checking to be sure we are comparing CSV data
if
not
isinstance
(
sourceFields
,
protocols
.
TabularFields
):
raise
IOError
(
"
Source file could not been identified as CSV-like file!
"
)
if
not
isinstance
(
referenceFields
,
protocols
.
TabularFields
):
raise
IOError
(
"
Reference file could not been identified as CSV-like file!
"
)
sourceFields
=
read_as
(
"
dsv
"
,
source
,
delimiter
=
delimiter
,
use_names
=
False
)
referenceFields
=
read_as
(
"
dsv
"
,
ref
,
delimiter
=
delimiter
,
use_names
=
False
)
ignoreFields
=
ignoreFields
or
[]
compare
=
FieldDataComparator
(
...
...
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