summaryrefslogtreecommitdiff
path: root/PyGan/data/assertS.py
diff options
context:
space:
mode:
authorstainer_t <thomas.stainer@oecd-nea.org>2025-09-08 13:48:49 +0200
committerstainer_t <thomas.stainer@oecd-nea.org>2025-09-08 13:48:49 +0200
commit7dfcc480ba1e19bd3232349fc733caef94034292 (patch)
tree03ee104eb8846d5cc1a981d267687a729185d3f3 /PyGan/data/assertS.py
Initial commit from Polytechnique Montreal
Diffstat (limited to 'PyGan/data/assertS.py')
-rwxr-xr-xPyGan/data/assertS.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/PyGan/data/assertS.py b/PyGan/data/assertS.py
new file mode 100755
index 0000000..07c76e7
--- /dev/null
+++ b/PyGan/data/assertS.py
@@ -0,0 +1,16 @@
+#
+# Assert procedure for non-regression testing
+# Recover a value from a real array
+# Author: A. Hebert
+#
+def assertS(lcmobj,key,ipos,refvalue):
+ val=lcmobj[key][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 assertS")