unified style
This commit is contained in:
parent
e6a87da37c
commit
b3f5ee022a
|
@ -7,7 +7,7 @@ import matplotlib.pyplot as plt
|
||||||
from matplotlib import cm
|
from matplotlib import cm
|
||||||
|
|
||||||
import damask
|
import damask
|
||||||
from damask import Table
|
from . import Table
|
||||||
|
|
||||||
_eps = 216./24389.
|
_eps = 216./24389.
|
||||||
_kappa = 24389./27.
|
_kappa = 24389./27.
|
||||||
|
@ -209,7 +209,7 @@ class Colormap(mpl.colors.ListedColormap):
|
||||||
colors+=[i]+c
|
colors+=[i]+c
|
||||||
|
|
||||||
out = [{
|
out = [{
|
||||||
'Creator':f'damask.Colormap {damask.version}',
|
'Creator':f'damask.Colormap v{damask.version}',
|
||||||
'ColorSpace':'RGB',
|
'ColorSpace':'RGB',
|
||||||
'Name':colormap.name,
|
'Name':colormap.name,
|
||||||
'DefaultMap':True,
|
'DefaultMap':True,
|
||||||
|
@ -226,7 +226,7 @@ class Colormap(mpl.colors.ListedColormap):
|
||||||
"""Write colormap to ASCII table."""
|
"""Write colormap to ASCII table."""
|
||||||
labels = {'R':(1,),'G':(1,),'B':(1,)}
|
labels = {'R':(1,),'G':(1,),'B':(1,)}
|
||||||
if colormap.colors.shape[1] == 4: labels['alpha']=(1,)
|
if colormap.colors.shape[1] == 4: labels['alpha']=(1,)
|
||||||
t = Table(colormap.colors,labels,f'Creator: damask.Colormap {damask.version}')
|
t = Table(colormap.colors,labels,f'Creator: damask.Colormap v{damask.version}')
|
||||||
|
|
||||||
if fhandle is None:
|
if fhandle is None:
|
||||||
with open(colormap.name.replace(' ','_')+'.txt', 'w') as f:
|
with open(colormap.name.replace(' ','_')+'.txt', 'w') as f:
|
||||||
|
|
|
@ -12,6 +12,7 @@ from functools import partial
|
||||||
import h5py
|
import h5py
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
|
import damask
|
||||||
from . import VTK
|
from . import VTK
|
||||||
from . import Table
|
from . import Table
|
||||||
from . import Rotation
|
from . import Rotation
|
||||||
|
@ -20,7 +21,6 @@ from . import Environment
|
||||||
from . import grid_filters
|
from . import grid_filters
|
||||||
from . import mechanics
|
from . import mechanics
|
||||||
from . import util
|
from . import util
|
||||||
from . import version
|
|
||||||
|
|
||||||
|
|
||||||
class Result:
|
class Result:
|
||||||
|
@ -1090,7 +1090,7 @@ class Result:
|
||||||
|
|
||||||
for l,v in result[1]['meta'].items():
|
for l,v in result[1]['meta'].items():
|
||||||
dataset.attrs[l]=v.encode()
|
dataset.attrs[l]=v.encode()
|
||||||
creator = f"damask.Result.{dataset.attrs['Creator'].decode()} v{version}"
|
creator = f"damask.Result.{dataset.attrs['Creator'].decode()} v{damask.version}"
|
||||||
dataset.attrs['Creator'] = creator.encode()
|
dataset.attrs['Creator'] = creator.encode()
|
||||||
|
|
||||||
except (OSError,RuntimeError) as err:
|
except (OSError,RuntimeError) as err:
|
||||||
|
|
|
@ -6,9 +6,9 @@ import vtk
|
||||||
from vtk.util.numpy_support import numpy_to_vtk as np_to_vtk
|
from vtk.util.numpy_support import numpy_to_vtk as np_to_vtk
|
||||||
from vtk.util.numpy_support import numpy_to_vtkIdTypeArray as np_to_vtkIdTypeArray
|
from vtk.util.numpy_support import numpy_to_vtkIdTypeArray as np_to_vtkIdTypeArray
|
||||||
|
|
||||||
|
import damask
|
||||||
from . import Table
|
from . import Table
|
||||||
from . import Environment
|
from . import Environment
|
||||||
from . import version
|
|
||||||
|
|
||||||
|
|
||||||
class VTK:
|
class VTK:
|
||||||
|
@ -214,7 +214,7 @@ class VTK:
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
"""ASCII representation of the VTK data."""
|
"""ASCII representation of the VTK data."""
|
||||||
writer = vtk.vtkDataSetWriter()
|
writer = vtk.vtkDataSetWriter()
|
||||||
writer.SetHeader(f'# DAMASK.VTK v{version}')
|
writer.SetHeader(f'# damask.VTK v{damask.version}')
|
||||||
writer.WriteToOutputStringOn()
|
writer.WriteToOutputStringOn()
|
||||||
writer.SetInputData(self.geom)
|
writer.SetInputData(self.geom)
|
||||||
writer.Write()
|
writer.Write()
|
||||||
|
|
Loading…
Reference in New Issue