diff --git a/python/damask/_colormap.py b/python/damask/_colormap.py index f6e6b62e7..9377ca277 100644 --- a/python/damask/_colormap.py +++ b/python/damask/_colormap.py @@ -234,6 +234,7 @@ class Colormap(mpl.colors.ListedColormap): @staticmethod def _export_GOM(colormap,fhandle=None): + """Write colormap to GOM Aramis compatible format.""" # ToDo: test in GOM GOM_str = f'1 1 {colormap.name.replace(" ","_")} 9 {colormap.name.replace(" ","_")} ' \ + '0 1 0 3 0 0 -1 9 \\ 0 0 0 255 255 255 0 0 255 ' \ @@ -249,6 +250,7 @@ class Colormap(mpl.colors.ListedColormap): @staticmethod def _export_gmsh(colormap,fhandle=None): + """Write colormap to Gmsh compatible format.""" # ToDo: test in gmsh gmsh_str = 'View.ColorTable = {\n' \ +'\n'.join([f'{c[0]},{c[1]},{c[2]},' for c in colormap.colors[:,:3]*255]) \ diff --git a/python/tests/test_Colormap.py b/python/tests/test_Colormap.py index dde14dcf3..f124c704e 100644 --- a/python/tests/test_Colormap.py +++ b/python/tests/test_Colormap.py @@ -82,7 +82,7 @@ class TestColormap: @pytest.mark.parametrize('format,name',[('ASCII','test.txt'), ('paraview','test.json'), ('GOM','test.legend'), - ('gmsh','test.xxx') + ('gmsh','test.msh') ]) def test_write_filehandle(self,format,name,tmpdir): c = Colormap.from_predefined('Dark2') @@ -111,7 +111,6 @@ class TestColormap: np.allclose(c_1.colors,c_2.reversed().colors) def test_list(self): - c = Colormap.from_predefined('afmhot').reversed() - c.list_predefined() + Colormap.list_predefined()