Пример #1
0
 def test_from_range(self, model, format, tmp_path):
     N = np.random.randint(2, 256)
     c = Colormap.from_range(np.random.rand(3),
                             np.random.rand(3),
                             model=model,
                             N=N)  # noqa
     eval(f'c.save_{format}(tmp_path/"color_out")')
Пример #2
0
 def test_from_range_types(self, low, high):
     assert Colormap.from_range(low, high) == Colormap.from_range(
         np.array(low), np.array(high))
Пример #3
0
 def test_invalid_color(self, model):
     with pytest.raises(ValueError):
         c = Colormap.from_range(-2. + np.random.rand(3),
                                 np.random.rand(3),
                                 N=10,
                                 model=model)  # noqa