'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:
try:
table = damask.ASCIItable(name = name, buffered = False)
table = damask.ASCIItable(name = name)
except IOError:
continue
damask.util.report(scriptName,name)

View File

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

View File

@ -126,7 +126,7 @@ if filenames == []: filenames = [None]
for name in filenames:
try:
table = damask.ASCIItable(name = name, buffered = False)
table = damask.ASCIItable(name = name)
except IOError:
continue
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]
for name in filenames:
try: table = damask.ASCIItable(name = name,
buffered = False)
except: continue
try:
table = damask.ASCIItable(name = name)
except IOError:
continue
damask.util.report(scriptName,name)
# ------------------------------------------ read header ------------------------------------------

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -234,7 +234,7 @@ if filenames == []: filenames = [None]
for name in filenames:
try:
table = damask.ASCIItable(name = name, buffered = False, readonly=True)
table = damask.ASCIItable(name = name, readonly=True)
except IOError:
continue
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:
fftdata = fftbuild(rcData, options.size, options.xmargin, options.ymargin, options.grid, options.extrusion)
table = damask.ASCIItable(outname = myName+'_'+str(int(fftdata['grid'][0]))+'.geom',
labeled = False,
buffered = False)
table = damask.ASCIItable(outname = myName+'_'+str(int(fftdata['grid'][0]))+'.geom', labeled = False)
table.labels_clear()
table.info_clear()
table.info_append([

View File

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