no DADF5 anymore
This commit is contained in:
Martin Diehl 2020-03-19 08:13:13 +01:00
parent fbd92599e8
commit d6f74daf53
5 changed files with 3 additions and 28 deletions

View File

@ -37,7 +37,7 @@ for filename in options.filenames:
N_digits = int(np.floor(np.log10(int(results.increments[-1][3:]))))+1
N_digits = 5 # hack to keep test intact
for inc in damask.util.show_progress(results.iter_visible('increments'),len(results.increments)):
for inc in damask.util.show_progress(results.iterate('increments'),len(results.increments)):
table = damask.Table(np.ones(np.product(results.grid),dtype=int)*int(inc[3:]),{'inc':(1,)})
table.add('pos',coords.reshape(-1,3))

View File

@ -60,8 +60,7 @@ options = parser.parse_args()
for filename in options.filenames:
f = damask.Result(filename)
f.pick('increments',options.inc)
for increment in damask.util.show_progress(f.iter_selection('increments'),len(f.selection['increments'])):
#-------output file creation-------------------------------------
for increment in damask.util.show_progress(f.iterate('increments'),len(f.selection['increments'])):
dirname = os.path.abspath(os.path.join(os.path.dirname(filename),options.dir))
try:
os.mkdir(dirname)
@ -69,10 +68,8 @@ for filename in options.filenames:
pass
o = h5py.File(dirname + '/' + os.path.splitext(filename)[0] + '_{}.dream3D'.format(increment),'w')
#-----------------------------------------------------------------
o.attrs['DADF5toDREAM3D'] = '1.0'
o.attrs['FileVersion'] = '7.0'
#-----------------------------------------------------------------
for g in ['DataContainerBundles','Pipeline']: # empty groups (needed)
o.create_group(g)

View File

@ -18,9 +18,6 @@ from .result import Result # noqa
from .geom import Geom # noqa
from .solver import Solver # noqa
# compatibility hack
from .result import Result as DADF5 # noqa
# deprecated
from .asciitable import ASCIItable # noqa
from .util import extendableOption # noqa

View File

@ -1094,7 +1094,6 @@ class Result:
###################################################################################################
# BEGIN DEPRECATED
iter_visible = iterate
iter_selection = iterate
def _time_to_inc(self,start,end):
@ -1118,21 +1117,3 @@ class Result:
"""
self._manage_selection('set','increments',self._time_to_inc(start,end))
def set_by_increment(self,start,end):
"""
Set active time increments based on start and end increment.
Parameters
----------
start : int
start increment (included)
end : int
end increment (included)
"""
if self.version_minor >= 4:
self._manage_selection('set','increments',[ 'inc{}'.format(i) for i in range(start,end+1)])
else:
self._manage_selection('set','increments',['inc{:05d}'.format(i) for i in range(start,end+1)])

View File

@ -27,7 +27,7 @@ class TestResult:
def test_time_increments(self,default):
shape = default.read_dataset(default.get_dataset_location('F'),0).shape
default.set_by_time(0.0,20.0)
for i in default.iter_visible('increments'):
for i in default.iterate('increments'):
assert shape == default.read_dataset(default.get_dataset_location('F'),0).shape