polishing
This commit is contained in:
parent
a80622292e
commit
91e728d065
|
@ -85,7 +85,14 @@ class Result:
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
"""Show selected data."""
|
"""Show selected data."""
|
||||||
return util.srepr(self.list_data())
|
all_selected_increments = self.selection['increments']
|
||||||
|
self.pick('increments',all_selected_increments[0:1])
|
||||||
|
first = self.list_data()
|
||||||
|
self.pick('increments',all_selected_increments[-1:])
|
||||||
|
last = self.list_data()
|
||||||
|
self.pick('increments',all_selected_increments)
|
||||||
|
in_between = ''.join(['\n{}\n ...\n'.format(inc) for inc in all_selected_increments[1:-2]])
|
||||||
|
return util.srepr(first+ in_between + last)
|
||||||
|
|
||||||
|
|
||||||
def _manage_selection(self,action,what,datasets):
|
def _manage_selection(self,action,what,datasets):
|
||||||
|
@ -171,13 +178,13 @@ class Result:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
datasets = self.selection[what]
|
datasets = self.selection[what]
|
||||||
last_datasets = datasets.copy()
|
last_selection = datasets.copy()
|
||||||
for dataset in datasets:
|
for dataset in datasets:
|
||||||
if last_datasets != self.selection[what]:
|
if last_selection != self.selection[what]:
|
||||||
self._manage_selection('set',what,datasets)
|
self._manage_selection('set',what,datasets)
|
||||||
raise Exception
|
raise Exception
|
||||||
self._manage_selection('set',what,dataset)
|
self._manage_selection('set',what,dataset)
|
||||||
last_datasets = self.selection[what]
|
last_selection = self.selection[what]
|
||||||
yield dataset
|
yield dataset
|
||||||
self._manage_selection('set',what,datasets)
|
self._manage_selection('set',what,datasets)
|
||||||
|
|
||||||
|
@ -664,7 +671,7 @@ class Result:
|
||||||
'meta' : {
|
'meta' : {
|
||||||
'Unit': 'RGB (8bit)',
|
'Unit': 'RGB (8bit)',
|
||||||
'Lattice': lattice,
|
'Lattice': lattice,
|
||||||
'Description': 'Inverse Pole Figure (IPF) colors for direction/plane [{} {} {})'.format(*m),
|
'Description': 'Inverse Pole Figure (IPF) colors along sample direction [{} {} {}]'.format(*m),
|
||||||
'Creator': 'result.py:add_IPFcolor v{}'.format(version)
|
'Creator': 'result.py:add_IPFcolor v{}'.format(version)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1014,13 +1021,13 @@ class Result:
|
||||||
pool.join()
|
pool.join()
|
||||||
|
|
||||||
|
|
||||||
def to_vtk(self,labels,mode='cell'):
|
def to_vtk(self,labels=[],mode='cell'):
|
||||||
"""
|
"""
|
||||||
Export to vtk cell/point data.
|
Export to vtk cell/point data.
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
----------
|
----------
|
||||||
labels : str or list of
|
labels : str or list of, optional
|
||||||
Labels of the datasets to be exported.
|
Labels of the datasets to be exported.
|
||||||
mode : str, either 'cell' or 'point'
|
mode : str, either 'cell' or 'point'
|
||||||
Export in cell format or point format.
|
Export in cell format or point format.
|
||||||
|
|
|
@ -688,11 +688,11 @@ subroutine crystallite_results
|
||||||
case('p')
|
case('p')
|
||||||
selected_tensors = select_tensors(crystallite_P,p)
|
selected_tensors = select_tensors(crystallite_P,p)
|
||||||
call results_writeDataset(group,selected_tensors,'P',&
|
call results_writeDataset(group,selected_tensors,'P',&
|
||||||
'1st Piola-Kirchoff stress','Pa')
|
'First Piola-Kirchoff stress','Pa')
|
||||||
case('s')
|
case('s')
|
||||||
selected_tensors = select_tensors(crystallite_S,p)
|
selected_tensors = select_tensors(crystallite_S,p)
|
||||||
call results_writeDataset(group,selected_tensors,'S',&
|
call results_writeDataset(group,selected_tensors,'S',&
|
||||||
'2nd Piola-Kirchoff stress','Pa')
|
'Second Piola-Kirchoff stress','Pa')
|
||||||
case('orientation')
|
case('orientation')
|
||||||
select case(lattice_structure(p))
|
select case(lattice_structure(p))
|
||||||
case(lattice_ISO_ID)
|
case(lattice_ISO_ID)
|
||||||
|
|
Loading…
Reference in New Issue