fixed handling of subfolders
now inline with post results. Still a little bit unclear what happens if an absolute directory is given. Probably best to either specify absolute or relative with respect to working directory
This commit is contained in:
parent
def665fb8b
commit
8793050329
|
@ -22,7 +22,7 @@ parser = argparse.ArgumentParser()
|
||||||
parser.add_argument('filenames', nargs='+',
|
parser.add_argument('filenames', nargs='+',
|
||||||
help='DADF5 files')
|
help='DADF5 files')
|
||||||
parser.add_argument('-d','--dir', dest='dir',default='postProc',metavar='string',
|
parser.add_argument('-d','--dir', dest='dir',default='postProc',metavar='string',
|
||||||
help='name of subdirectory to hold output')
|
help='name of subdirectory relative to the location of the DADF5 file to hold output')
|
||||||
parser.add_argument('--mat', nargs='+',
|
parser.add_argument('--mat', nargs='+',
|
||||||
help='labels for materialpoint',dest='mat')
|
help='labels for materialpoint',dest='mat')
|
||||||
parser.add_argument('--con', nargs='+',
|
parser.add_argument('--con', nargs='+',
|
||||||
|
@ -90,9 +90,7 @@ for filename in options.filenames:
|
||||||
header+=' '+label
|
header+=' '+label
|
||||||
|
|
||||||
dirname = os.path.abspath(os.path.join(os.path.dirname(filename),options.dir))
|
dirname = os.path.abspath(os.path.join(os.path.dirname(filename),options.dir))
|
||||||
try:
|
if not os.path.isdir(dirname):
|
||||||
os.mkdir(dirname)
|
os.mkdir(dirname,0o755)
|
||||||
except FileExistsError:
|
file_out = '{}_{}.txt'.format(os.path.splitext(os.path.split(filename)[-1])[0],inc)
|
||||||
pass
|
|
||||||
file_out = '{}_{}.txt'.format(filename.split('.')[0],inc)
|
|
||||||
np.savetxt(os.path.join(dirname,file_out),data,header=header,comments='')
|
np.savetxt(os.path.join(dirname,file_out),data,header=header,comments='')
|
||||||
|
|
|
@ -24,7 +24,7 @@ parser = argparse.ArgumentParser()
|
||||||
parser.add_argument('filenames', nargs='+',
|
parser.add_argument('filenames', nargs='+',
|
||||||
help='DADF5 files')
|
help='DADF5 files')
|
||||||
parser.add_argument('-d','--dir', dest='dir',default='postProc',metavar='string',
|
parser.add_argument('-d','--dir', dest='dir',default='postProc',metavar='string',
|
||||||
help='name of subdirectory to hold output')
|
help='name of subdirectory relative to the location of the DADF5 file to hold output')
|
||||||
parser.add_argument('--mat', nargs='+',
|
parser.add_argument('--mat', nargs='+',
|
||||||
help='labels for materialpoint',dest='mat')
|
help='labels for materialpoint',dest='mat')
|
||||||
parser.add_argument('--con', nargs='+',
|
parser.add_argument('--con', nargs='+',
|
||||||
|
@ -115,11 +115,9 @@ for filename in options.filenames:
|
||||||
|
|
||||||
|
|
||||||
dirname = os.path.abspath(os.path.join(os.path.dirname(filename),options.dir))
|
dirname = os.path.abspath(os.path.join(os.path.dirname(filename),options.dir))
|
||||||
try:
|
if not os.path.isdir(dirname):
|
||||||
os.mkdir(dirname)
|
os.mkdir(dirname,0o755)
|
||||||
except FileExistsError:
|
file_out = '{}_{}.{}'.format(os.path.splitext(os.path.split(filename)[-1])[0],inc,writer.GetDefaultFileExtension())
|
||||||
pass
|
|
||||||
file_out = '{}_{}.{}'.format(filename.split('.')[0],inc,writer.GetDefaultFileExtension())
|
|
||||||
|
|
||||||
writer.SetCompressorTypeToZLib()
|
writer.SetCompressorTypeToZLib()
|
||||||
writer.SetDataModeToBinary()
|
writer.SetDataModeToBinary()
|
||||||
|
|
Loading…
Reference in New Issue