- 27 Jul, 2020 7 commits
-
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
def edit( fn ): fnn = re.sub( r'^\./', '', fn ) # print(fnn) # read in fd = open( fn, 'r' ) ti = fd.read() fd.close t = ti pattern = r'\n\s*_cerf_cmplx z\[NTST\] = \{\s*?((C\(.+?,\s*?.+?\)(,\s*|\s*\};\s*))+)' + \ r'\n\s*_cerf_cmplx w\[NTST\] = \{\s*?((C\(.+?,\s*?.+?\)(,\s*|\s*\};\s*))+)' + \ r'.*?zTest\(.*?,.*?, (%s),.*?\);' zz = {} ww = {} names = [] rr = re.compile(pattern % r'\w+') for m in re.finditer(rr, t): name = m.group(7) zz[name] = m.group(1) ww[name] = m.group(4) names.append(name) print("found names", names) def mysplit(s): ret = [] for m in re.finditer(r'C\(.+?,\s*?.+?\)', s): ret.append(m.group(0)) return ret for name in names: za = mysplit(zz[name]) wa = mysplit(ww[name]) if len(za)!=len(wa): raise Exception("array mismatch") out = "" for i in range(len(za)): out += " ZTEST(result, 1e-13, %s(%s), %s);\n" % ( name, za[i], wa[i] ) print("...", name, ":", len(za), "tests") rr = re.compile(pattern % name) t = re.sub(rr, out, t, 1) # save result if t==ti: return 0 print( "Changed " + fn ) fd = open( fn, 'w' ) fd.write( t ) fd.close return 1
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
code blocks
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
- 10 Jul, 2020 9 commits
-
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
- 09 Jul, 2020 3 commits
-
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
- 08 Jul, 2020 6 commits
-
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
- 22 Jun, 2020 3 commits
-
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
- 25 May, 2020 2 commits
-
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
- 17 Feb, 2020 1 commit
-
-
Wuttke, Joachim authored
-
- 18 Dec, 2019 2 commits
-
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
- 13 Dec, 2019 4 commits
-
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
- 03 Jul, 2019 3 commits
-
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-
Wuttke, Joachim authored
-