test from_range; update ASCII colormap labels (i_RGBA)

This commit is contained in:
Philip Eisenlohr 2020-06-29 22:23:24 -04:00
parent decbe8074a
commit 8dc87023d1
2 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
# Creator: damask.Colormap v99.99.99-9999-pytest
R G B alpha
1_RGBA 2_RGBA 3_RGBA 4_RGBA
1.0 1.0 1.0 1.0
0.996078431372549 0.996078431372549 0.996078431372549 1.0
0.9921568627450981 0.9921568627450981 0.9921568627450981 1.0

View File

@ -74,9 +74,9 @@ class TestColormap:
@pytest.mark.parametrize('format',['ASCII','paraview','GOM','Gmsh'])
@pytest.mark.parametrize('model',['rgb','hsv','hsl','xyz','lab','msh'])
def test_from_bounds(self,model,format,tmpdir):
def test_from_range(self,model,format,tmpdir):
N = np.random.randint(2,256)
c = Colormap.from_bounds(np.random.rand(3),np.random.rand(3),model=model,N=N)
c = Colormap.from_range(np.random.rand(3),np.random.rand(3),model=model,N=N)
c.to_file(tmpdir/'color_out',format=format)
@pytest.mark.parametrize('format',['ASCII','paraview','GOM','Gmsh'])
@ -110,7 +110,7 @@ class TestColormap:
@pytest.mark.parametrize('model',['rgb','hsv','hsl','lab','invalid'])
def test_invalid_color(self,model):
with pytest.raises(ValueError):
c = Colormap.from_bounds(-2.+np.random.rand(3),np.random.rand(3),N=10,model=model) # noqa
c = Colormap.from_range(-2.+np.random.rand(3),np.random.rand(3),N=10,model=model) # noqa
def test_reversed(self):
c_1 = Colormap.from_predefined('stress')