diff options
| author | stainer_t <thomas.stainer@oecd-nea.org> | 2025-09-08 13:48:49 +0200 |
|---|---|---|
| committer | stainer_t <thomas.stainer@oecd-nea.org> | 2025-09-08 13:48:49 +0200 |
| commit | 7dfcc480ba1e19bd3232349fc733caef94034292 (patch) | |
| tree | 03ee104eb8846d5cc1a981d267687a729185d3f3 /PyGan/data/assertV.py | |
Initial commit from Polytechnique Montreal
Diffstat (limited to 'PyGan/data/assertV.py')
| -rwxr-xr-x | PyGan/data/assertV.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/PyGan/data/assertV.py b/PyGan/data/assertV.py new file mode 100755 index 0000000..84183fa --- /dev/null +++ b/PyGan/data/assertV.py @@ -0,0 +1,17 @@ +# +# Assert procedure for non-regression testing +# Recover a value from a list of real arrays +# Author: A. Hebert +# +def assertV(lcmobj,key,iset,ipos,refvalue): + lcmobj.lib() + val=lcmobj[key][iset-1][ipos-1] + delta=abs((val-refvalue)/refvalue) + if delta < 1.0e-4: + print("Test successful; delta=",delta) + else: + print("Reference=",refvalue,"Calculated=",val) + print("------------") + print("TEST FAILURE") + print("------------") + raise Exception("abort in assertV") |
