The TS-GitLab will have to shut down in the near future — please plan migrating your projects to GitLab.com or GitHub. Contact @yunus for more information.

Commit 3df46e37 authored by Lukas Riedel's avatar Lukas Riedel 🎧
Browse files

Remove parfield reference tests.

Tests are useless because different compilers yield different results.

* Removed H5 reference files (were deprecated anyway).
* Removed testtools for pfg.
* Removed meta ini file.
parent bc799d98
from dorie.utilities._load_all_in_folder import load
"""
Import script to allow for statements of the form
from dorie.testtools.dorie_pfg import correlation
"""
load("dorie.testtools.dorie_pfg",__file__)
import os
import h5py
import numpy as np
from dorie.testtools.utilities.decorators import evaluation_script
from dorie.parfield.parameter_file import read_parameter_file
@evaluation_script
def evaluate(iniinfo,runtime):
outfile = iniinfo["general.outputFile"]
try:
reference = iniinfo["_reference.path"] + "/" + iniinfo["general.outputFile"]
except KeyError:
raise ValueError("The reference evaluator assumes the key _reference.path to be existent in the inifile")
if not os.path.isfile(reference):
raise RuntimeError("Reference file {} does not exist".format(reference))
f1_data, f1_attrs = read_parameter_file(outfile)
f2_data, f2_attrs = read_parameter_file(reference)
if f1_data.keys() != f2_data.keys():
print("Data keys do not match: Got {} and {}".format(" ,".join(f1_data.keys()),
" ,".join(f2_data.keys())))
return False
if f1_attrs.keys() != f2_attrs.keys():
print("Attribute keys do not match: Got {} and {}".format(" ,".join(f1_attrs.keys()),
" ,".join(f2_attrs.keys())))
for key in f1_attrs.keys():
if not np.array_equal(f1_attrs[key],f2_attrs[key]):
print("Attributes do not match in key {}: Got {} and {}".format(key,repr(f1_attrs[key]),repr(f2_attrs[key])))
return False
for key in f1_data.keys():
if not np.allclose(f1_data[key],f2_data[key]):
print("Data does not match in key {}".format(key))
return False
return True
......@@ -41,7 +41,6 @@ add_custom_target(test_run_parallel
)
# dorie exec tests
dorie_add_metaini_test(TARGET dorie-rfg METAINI parfield.mini.in)
dorie_add_metaini_test(TARGET dorie METAINI run.mini.in)
set_tests_properties(dorie-rfg_exec_0000 PROPERTIES FIXTURES_SETUP dorie_run)
set_tests_properties(dorie_exec_run PROPERTIES FIXTURES_REQUIRED dorie_run)
......
include ${CMAKE_BINARY_DIR}/doc/default_files/parfield.ini
__name = exec
_test_command = pfg
_asset_path = "${CMAKE_CURRENT_LIST_DIR}"
_data_path = {_asset_path}/parfield-data
_evaluation = reference
[_reference]
path = {_asset_path}/references/parfield
[general]
generator = fft, image, csv, hdf5 | expand input_type
inputFile = UNDEFINED, {_data_path}/test.png, {_data_path}/test.csv, {_data_path}/test.h5 | expand input_type
outputFile = fft.h5, image.h5, csv.h5, h5.h5 | expand input_type
parameterization = vanGenuchten
overwrite = true
[generator]
dimensions = 2, 2, 2, 3 | expand input_type
extensions = 1 1, 1 1, 1 1, 1 1 1 | expand input_type
millerSimilarity = false
[generator.fft]
N = 50 50
newField = true
newEV = true
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment