diff --git a/python/damask/_grid.py b/python/damask/_grid.py index 0077a0309..b20b52366 100644 --- a/python/damask/_grid.py +++ b/python/damask/_grid.py @@ -688,7 +688,7 @@ class Grid: def show(self, - colormap: Union[Colormap, str] = None) -> None: + colormap: Union[Colormap, str] = 'cividis') -> None: """ Show on screen. diff --git a/python/damask/_vtk.py b/python/damask/_vtk.py index 13b345091..f8dce1754 100644 --- a/python/damask/_vtk.py +++ b/python/damask/_vtk.py @@ -503,7 +503,7 @@ class VTK: def show(self, label: str = None, - colormap: Union[Colormap, str] = None): + colormap: Union[Colormap, str] = 'cividis'): """ Render. @@ -516,7 +516,7 @@ class VTK: Notes ----- - See http://compilatrix.com/article/vtk-1 for further ideas. + See http://compilatrix.com/article/vtk-1 for further ideas. """ try: @@ -535,9 +535,8 @@ class VTK: height = 768 lut = vtk.vtkLookupTable() - colormap_ = Colormap.from_predefined('cividis') if colormap is None \ - else Colormap.from_predefined(colormap) if isinstance(colormap,str) \ - else colormap + colormap_ = Colormap.from_predefined(colormap) if isinstance(colormap,str) else \ + colormap lut.SetNumberOfTableValues(len(colormap_.colors)) for i,c in enumerate(colormap_.colors): lut.SetTableValue(i,c if len(c)==4 else np.append(c,1.0)) diff --git a/python/tests/test_Grid.py b/python/tests/test_Grid.py index 417d92507..5721c6428 100644 --- a/python/tests/test_Grid.py +++ b/python/tests/test_Grid.py @@ -43,7 +43,7 @@ class TestGrid: print('patched datetime.datetime.now') - @pytest.mark.parametrize('cmap',[Colormap.from_predefined('cividis'),'cividis',None]) + @pytest.mark.parametrize('cmap',[Colormap.from_predefined('stress'),'viridis']) def test_show(sef,default,cmap,monkeypatch): monkeypatch.delenv('DISPLAY',raising=False) default.show(cmap) diff --git a/python/tests/test_VTK.py b/python/tests/test_VTK.py index 2cf7e411f..c776135e1 100644 --- a/python/tests/test_VTK.py +++ b/python/tests/test_VTK.py @@ -30,7 +30,7 @@ class TestVTK: def _patch_execution_stamp(self, patch_execution_stamp): print('patched damask.util.execution_stamp') - @pytest.mark.parametrize('cmap',[Colormap.from_predefined('cividis'),'cividis',None]) + @pytest.mark.parametrize('cmap',[Colormap.from_predefined('cividis'),'strain']) def test_show(sef,default,cmap,monkeypatch): monkeypatch.delenv('DISPLAY',raising=False) default.show(colormap=cmap)