'buffered' has no effect any more

This commit is contained in:
Martin Diehl 2020-02-20 15:05:38 +01:00
parent a8e2ee0a86
commit e93f5c84ff
18 changed files with 57 additions and 60 deletions

View File

@ -66,7 +66,7 @@ if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
try: try:
table = damask.ASCIItable(name = name, buffered = False) table = damask.ASCIItable(name = name)
except IOError: except IOError:
continue continue
damask.util.report(scriptName,name) damask.util.report(scriptName,name)

View File

@ -61,8 +61,8 @@ if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
try: try:
table = damask.ASCIItable(name = name, buffered = False) table = damask.ASCIItable(name = name)
except: except IOError:
continue continue
damask.util.report(scriptName,name) damask.util.report(scriptName,name)

View File

@ -47,9 +47,7 @@ if options.link is None:
if options.asciitable is not None and os.path.isfile(options.asciitable): if options.asciitable is not None and os.path.isfile(options.asciitable):
linkedTable = damask.ASCIItable(name = options.asciitable, linkedTable = damask.ASCIItable(name = options.asciitable, readonly = True)
buffered = False,
readonly = True)
linkedTable.head_read() # read ASCII header info of linked table linkedTable.head_read() # read ASCII header info of linked table
linkDim = linkedTable.label_dimension(options.link[1]) # dimension of linking column linkDim = linkedTable.label_dimension(options.link[1]) # dimension of linking column
@ -72,9 +70,10 @@ else:
if filenames == []: filenames = [None] if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
try: table = damask.ASCIItable(name = name, try:
buffered = False) table = damask.ASCIItable(name = name)
except: continue except IOError:
continue
damask.util.report(scriptName,"{} {} <== {} {}".format(name,damask.util.deemph('@ '+options.link[0]), damask.util.report(scriptName,"{} {} <== {} {}".format(name,damask.util.deemph('@ '+options.link[0]),
options.asciitable,damask.util.deemph('@ '+options.link[1]))) options.asciitable,damask.util.deemph('@ '+options.link[1])))

View File

@ -126,7 +126,7 @@ if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
try: try:
table = damask.ASCIItable(name = name, buffered = False) table = damask.ASCIItable(name = name)
except IOError: except IOError:
continue continue
damask.util.report(scriptName,name) damask.util.report(scriptName,name)

View File

@ -182,9 +182,10 @@ slip_normal /= np.tile(np.linalg.norm(slip_normal ,axis=1),(3,1)).T
if filenames == []: filenames = [None] if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
try: table = damask.ASCIItable(name = name, try:
buffered = False) table = damask.ASCIItable(name = name)
except: continue except IOError:
continue
damask.util.report(scriptName,name) damask.util.report(scriptName,name)
# ------------------------------------------ read header ------------------------------------------ # ------------------------------------------ read header ------------------------------------------

View File

@ -90,13 +90,14 @@ if options.weight is not None: labels += [options.weight]
if filenames == []: filenames = [None] if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
try: table = damask.ASCIItable(name = name, try:
outname = os.path.join(os.path.dirname(name), table = damask.ASCIItable(name = name,
'binned-{}-{}_'.format(*options.data) + outname = os.path.join(os.path.dirname(name),
('weighted-{}_'.format(options.weight) if options.weight else '') + 'binned-{}-{}_'.format(*options.data) +
os.path.basename(name)) if name else name, ('weighted-{}_'.format(options.weight) if options.weight else '') +
buffered = False) os.path.basename(name)) if name else name)
except: continue except IOError:
continue
damask.util.report(scriptName,name) damask.util.report(scriptName,name)
# ------------------------------------------ read header ------------------------------------------ # ------------------------------------------ read header ------------------------------------------

View File

@ -66,9 +66,10 @@ parser.set_defaults(condition = None,
if filenames == []: filenames = [None] if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
try: table = damask.ASCIItable(name = name, try:
buffered = False) table = damask.ASCIItable(name = name)
except: continue except IOError:
continue
damask.util.report(scriptName,name) damask.util.report(scriptName,name)
# ------------------------------------------ assemble info --------------------------------------- # ------------------------------------------ assemble info ---------------------------------------

View File

@ -87,9 +87,10 @@ if not hasattr(mapFunction,'__call__'):
if filenames == []: filenames = [None] if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
try: table = damask.ASCIItable(name = name, try:
buffered = False) table = damask.ASCIItable(name = name)
except: continue except IOError:
continue
damask.util.report(scriptName,name) damask.util.report(scriptName,name)
# ------------------------------------------ sanity checks --------------------------------------- # ------------------------------------------ sanity checks ---------------------------------------

View File

@ -76,10 +76,10 @@ else:
if filenames == []: filenames = [None] if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
try: table = damask.ASCIItable(name = name, try:
buffered = False, table = damask.ASCIItable(name = name, readonly = True)
readonly = True) except IOError:
except: continue continue
damask.util.report(scriptName,name) damask.util.report(scriptName,name)
# ------------------------------------------ read header ------------------------------------------ # ------------------------------------------ read header ------------------------------------------

View File

@ -117,11 +117,9 @@ if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
try: try:
table = damask.ASCIItable(name = name, table = damask.ASCIItable(name = name, labeled = options.label is not None, readonly = True)
buffered = False, except IOError:
labeled = options.label is not None, continue
readonly = True)
except: continue
damask.util.report(scriptName,name) damask.util.report(scriptName,name)
# ------------------------------------------ read header ------------------------------------------ # ------------------------------------------ read header ------------------------------------------

View File

@ -114,11 +114,10 @@ if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
try: try:
table = damask.ASCIItable(name = name, table = damask.ASCIItable(name = name, readonly = True,
buffered = False, labeled = options.label is not None)
labeled = options.label is not None, except IOError:
readonly = True) continue
except: continue
table.report_name(scriptName,name) table.report_name(scriptName,name)
# ------------------------------------------ read header ------------------------------------------ # ------------------------------------------ read header ------------------------------------------

View File

@ -82,11 +82,10 @@ if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
try: try:
table = damask.ASCIItable(name = name, table = damask.ASCIItable(name = name, readonly = True,
buffered = False, labeled = options.label is not None)
labeled = options.label is not None, except IOError:
readonly = True) continue
except: continue
damask.util.report(scriptName,name) damask.util.report(scriptName,name)
# ------------------------------------------ read header ------------------------------------------ # ------------------------------------------ read header ------------------------------------------

View File

@ -51,8 +51,7 @@ if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
try: try:
table = damask.ASCIItable(name = name, table = damask.ASCIItable(name = name)
buffered = False)
except IOError: except IOError:
continue continue
damask.util.report(scriptName,name) damask.util.report(scriptName,name)

View File

@ -52,9 +52,9 @@ if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
try: try:
table = damask.ASCIItable(name = name, table = damask.ASCIItable(name = name)
buffered = False) except IOError:
except: continue continue
damask.util.report(scriptName,name) damask.util.report(scriptName,name)
# --- interpret header ---------------------------------------------------------------------------- # --- interpret header ----------------------------------------------------------------------------

View File

@ -60,9 +60,9 @@ if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
try: try:
table = damask.ASCIItable(name = name, table = damask.ASCIItable(name = name, labeled = options.labeled, readonly = True)
buffered = False, labeled = options.labeled, readonly = True) except IOError:
except: continue continue
details = ', '.join( details = ', '.join(
(['header'] if options.table else []) + (['header'] if options.table else []) +
(['info'] if options.head or options.info else []) + (['info'] if options.head or options.info else []) +

View File

@ -234,7 +234,7 @@ if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
try: try:
table = damask.ASCIItable(name = name, buffered = False, readonly=True) table = damask.ASCIItable(name = name, readonly=True)
except IOError: except IOError:
continue continue
damask.util.report(scriptName,name) damask.util.report(scriptName,name)

View File

@ -966,9 +966,7 @@ if any(output in options.output for output in ['spectral','mentat']):
if 'spectral' in options.output: if 'spectral' in options.output:
fftdata = fftbuild(rcData, options.size, options.xmargin, options.ymargin, options.grid, options.extrusion) fftdata = fftbuild(rcData, options.size, options.xmargin, options.ymargin, options.grid, options.extrusion)
table = damask.ASCIItable(outname = myName+'_'+str(int(fftdata['grid'][0]))+'.geom', table = damask.ASCIItable(outname = myName+'_'+str(int(fftdata['grid'][0]))+'.geom', labeled = False)
labeled = False,
buffered = False)
table.labels_clear() table.labels_clear()
table.info_clear() table.info_clear()
table.info_append([ table.info_append([

View File

@ -132,9 +132,10 @@ random.seed(options.randomSeed)
if filenames == []: filenames = [None] if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
try: table = damask.ASCIItable(outname = name, try:
buffered = False) table = damask.ASCIItable(outname = name)
except: continue except IOError:
continue
damask.util.report(scriptName,name) damask.util.report(scriptName,name)
# --- sanity checks ------------------------------------------------------------------------- # --- sanity checks -------------------------------------------------------------------------