Skip to content

Commit

Permalink
Fixed some issues in color mapping introduced after code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
forman committed Jul 19, 2024
1 parent 2aa8eb1 commit d4d7152
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/util/test_cmaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def test_get_cmap_from_code_type_key(self):
self.assertIsInstance(cmap(np.linspace(0, 1, 10)), np.ndarray)
self.assertIsInstance(colormap, Colormap)
self.assertEqual("ucb783473", colormap.cm_name)
self.assertEqual("key", colormap.cm_type)
self.assertEqual(CUSTOM_CATEGORY.name, colormap.cat_name)
self.assertEqual([1, 2, 3, 5, 6], colormap.values)

Expand All @@ -129,6 +130,7 @@ def test_get_cmap_from_code_type_bound(self):
self.assertIsInstance(cmap(np.linspace(0, 1, 10)), np.ndarray)
self.assertIsInstance(colormap, Colormap)
self.assertEqual("ucb783474", colormap.cm_name)
self.assertEqual("bound", colormap.cm_type)
self.assertEqual(CUSTOM_CATEGORY.name, colormap.cat_name)
self.assertEqual((0.0, 0.6, 1.0), colormap.values)

Expand All @@ -146,6 +148,7 @@ def test_get_cmap_from_code_reversed_alpha(self):
self.assertIsInstance(cmap(np.linspace(0, 1, 10)), np.ndarray)
self.assertIsInstance(colormap, Colormap)
self.assertEqual("ucb783475", colormap.cm_name)
self.assertEqual("node", colormap.cm_type)
self.assertEqual(CUSTOM_CATEGORY.name, colormap.cat_name)
self.assertEqual((0.0, 0.5, 1.0), colormap.values)

Expand All @@ -157,6 +160,7 @@ def test_get_cmap_from_code_invalid(self):
self.assertIsInstance(cmap, matplotlib.colors.LinearSegmentedColormap)
self.assertIsInstance(colormap, Colormap)
self.assertEqual("Reds", colormap.cm_name)
self.assertEqual("node", colormap.cm_type)
self.assertEqual("Sequential", colormap.cat_name)
self.assertIsNone(colormap.values)

Expand Down

0 comments on commit d4d7152

Please sign in to comment.