From d6f74daf532c5f85a17fe1e222d0361054fb6f7a Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 19 Mar 2020 08:13:13 +0100 Subject: [PATCH] cleaning no DADF5 anymore --- processing/post/DADF5_postResults.py | 2 +- processing/post/DADF5toDREAM3D.py | 5 +---- python/damask/__init__.py | 3 --- python/damask/result.py | 19 ------------------- python/tests/test_Result.py | 2 +- 5 files changed, 3 insertions(+), 28 deletions(-) diff --git a/processing/post/DADF5_postResults.py b/processing/post/DADF5_postResults.py index 2d03f17a6..70c883aeb 100755 --- a/processing/post/DADF5_postResults.py +++ b/processing/post/DADF5_postResults.py @@ -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)) diff --git a/processing/post/DADF5toDREAM3D.py b/processing/post/DADF5toDREAM3D.py index 64e098a58..af8e1067b 100755 --- a/processing/post/DADF5toDREAM3D.py +++ b/processing/post/DADF5toDREAM3D.py @@ -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) diff --git a/python/damask/__init__.py b/python/damask/__init__.py index d0ebd45a7..0ed1e27b9 100644 --- a/python/damask/__init__.py +++ b/python/damask/__init__.py @@ -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 diff --git a/python/damask/result.py b/python/damask/result.py index e66670d68..e50a689fb 100644 --- a/python/damask/result.py +++ b/python/damask/result.py @@ -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)]) diff --git a/python/tests/test_Result.py b/python/tests/test_Result.py index 8e4f834ed..a90430096 100644 --- a/python/tests/test_Result.py +++ b/python/tests/test_Result.py @@ -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