simplified reporting using "emph"
This commit is contained in:
parent
8f32d03a9e
commit
5f9fae1b75
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
import os,sys
|
import os,sys
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
import util
|
||||||
|
|
||||||
class ASCIItable():
|
class ASCIItable():
|
||||||
'''
|
'''
|
||||||
|
@ -67,6 +68,10 @@ class ASCIItable():
|
||||||
or hasattr(what, "__iter__") else str(what))
|
or hasattr(what, "__iter__") else str(what))
|
||||||
+('\n' if newline else '')),
|
+('\n' if newline else '')),
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------
|
||||||
|
def report_name(self, scriptName, fileName):
|
||||||
|
self.croak(util.emph(scriptName)+(': '+fileName if fileName else ''))
|
||||||
|
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
def close(self,
|
def close(self,
|
||||||
dismiss = False):
|
dismiss = False):
|
||||||
|
|
|
@ -55,7 +55,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name, buffered = False)
|
table = damask.ASCIItable(name = name, buffered = False)
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header -------------------------------------------
|
# ------------------------------------------ read header -------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name, buffered = False)
|
table = damask.ASCIItable(name = name, buffered = False)
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,
|
table = damask.ASCIItable(name = name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,
|
table = damask.ASCIItable(name = name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,buffered = False)
|
table = damask.ASCIItable(name = name,buffered = False)
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,
|
table = damask.ASCIItable(name = name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,
|
table = damask.ASCIItable(name = name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name, buffered = False)
|
table = damask.ASCIItable(name = name, buffered = False)
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,buffered = False)
|
table = damask.ASCIItable(name = name,buffered = False)
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name, buffered = False)
|
table = damask.ASCIItable(name = name, buffered = False)
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name, buffered = False)
|
table = damask.ASCIItable(name = name, buffered = False)
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,
|
table = damask.ASCIItable(name = name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header -------------------------------------------
|
# ------------------------------------------ read header -------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,
|
table = damask.ASCIItable(name = name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,
|
table = damask.ASCIItable(name = name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,
|
table = damask.ASCIItable(name = name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,
|
table = damask.ASCIItable(name = name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,
|
table = damask.ASCIItable(name = name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,
|
table = damask.ASCIItable(name = name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,
|
table = damask.ASCIItable(name = name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,
|
table = damask.ASCIItable(name = name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
table.head_read() # read ASCII header info
|
table.head_read() # read ASCII header info
|
||||||
|
|
||||||
|
|
|
@ -308,7 +308,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,buffered = False)
|
table = damask.ASCIItable(name = name,buffered = False)
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
table.head_read() # read ASCII header info
|
table.head_read() # read ASCII header info
|
||||||
table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:]))
|
table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:]))
|
||||||
|
|
|
@ -38,7 +38,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,
|
table = damask.ASCIItable(name = name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,
|
table = damask.ASCIItable(name = name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ for name in filenames:
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
|
|
||||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
tables = []
|
tables = []
|
||||||
for addTable in options.table:
|
for addTable in options.table:
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -65,7 +65,7 @@ for name in filenames:
|
||||||
prefix+os.path.basename(name)) if name else name,
|
prefix+os.path.basename(name)) if name else name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ for name in filenames:
|
||||||
outname = options.label+'_averaged_'+name if name else name,
|
outname = options.label+'_averaged_'+name if name else name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ sanity checks ---------------------------------------
|
# ------------------------------------------ sanity checks ---------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ for name in filenames:
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ for name in filenames:
|
||||||
os.path.basename(name)) if name else name,
|
os.path.basename(name)) if name else name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,
|
table = damask.ASCIItable(name = name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ assemble info -----------------------------------------
|
# ------------------------------------------ assemble info -----------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,
|
table = damask.ASCIItable(name = name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ assemble info ---------------------------------------
|
# ------------------------------------------ assemble info ---------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,7 @@ for name in filenames:
|
||||||
labeled = options.label != None,
|
labeled = options.label != None,
|
||||||
readonly = True)
|
readonly = True)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,7 @@ for name in filenames:
|
||||||
labeled = options.label != None,
|
labeled = options.label != None,
|
||||||
readonly = True)
|
readonly = True)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ for name in filenames:
|
||||||
labeled = options.label != None,
|
labeled = options.label != None,
|
||||||
readonly = True)
|
readonly = True)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,
|
table = damask.ASCIItable(name = name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,
|
table = damask.ASCIItable(name = name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,
|
table = damask.ASCIItable(name = name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,
|
table = damask.ASCIItable(name = name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,
|
table = damask.ASCIItable(name = name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ read header ------------------------------------------
|
# ------------------------------------------ read header ------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,
|
table = damask.ASCIItable(name = name,
|
||||||
buffered = False, labeled = options.labeled, readonly = True)
|
buffered = False, labeled = options.labeled, readonly = True)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ output head ---------------------------------------
|
# ------------------------------------------ output head ---------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ for name in filenames:
|
||||||
table = damask.ASCIItable(name = name,
|
table = damask.ASCIItable(name = name,
|
||||||
buffered = False)
|
buffered = False)
|
||||||
except: continue
|
except: continue
|
||||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
table.report_name(scriptName,name)
|
||||||
|
|
||||||
# ------------------------------------------ assemble header ---------------------------------------
|
# ------------------------------------------ assemble header ---------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue