From 31579b3f88b7aeeb82182aca9b0551d48cab37e5 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 22 Oct 2015 05:59:11 +0000 Subject: [PATCH] tolerances caused problems, introduced new funtionality based on np.allclose --- lib/damask/test/test.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/damask/test/test.py b/lib/damask/test/test.py index 08e659648..e1292477d 100644 --- a/lib/damask/test/test.py +++ b/lib/damask/test/test.py @@ -382,6 +382,24 @@ class Test(): logging.info(' ********') return maxError + + def compare_Table2(self,file0,file1,headings0=None,headings1=None,rtol=1e-5,atol=1e-8): + + import numpy as np + logging.info('comparing ASCII Tables\n %s \n %s'%(file0,file1)) + + if headings1 == None: headings1=headings0 + + table0 = damask.ASCIItable(file0,readonly=True) + table0.head_read() + table0.data_readArray(headings0) + table1 = damask.ASCIItable(file1,readonly=True) + table1.head_read() + table1.data_readArray(headings1) + + return np.allclose(table0.data,table1.data,rtol,atol) + + def compare_TableRefCur(self,headingsRef,ref,headingsCur='',cur='',normHeadings='',normType=None,\ absoluteTolerance=False,perLine=False,skipLines=[]):