pyrc.tests.test_color#

class TestColormap(methodName='runTest')#

Bases: TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_available_filter_discrete()#

available(‘discrete’) returns only discrete-kind entries.

test_available_filter_explicit()#

available(‘explicit’) returns only explicit-kind entries.

test_available_filter_uniform()#

available(‘uniform’) returns only uniform-kind entries.

test_clipping()#

Values outside [0, 1] are clipped to the boundary colours.

test_colormaps_loaded()#

At least one colormap is discovered and loaded at import time.

test_cycle_palette_discrete_wraps()#

After exhausting all swatches the generator restarts from the first.

test_cycle_palette_discrete_yields_correct_colors()#

Generator yields palette swatches in file order.

test_cycle_palette_uniform_wraps()#

After exhausting all table rows the generator restarts from the first.

test_cycle_palette_uniform_yields_correct_colors()#

Generator yields uniform table rows in order.

test_cycle_palette_unknown_raises()#

cycle_palette raises KeyError for an unknown colormap name.

test_cycle_palette_yields_float32()#

Each value yielded by the generator has dtype float32.

test_deterministic()#

Identical inputs always produce identical RGB outputs.

test_endpoints_uniform()#

v=0 and v=1 map exactly to the first and last table rows.

test_get_palette_raises_for_gradient()#

get_palette raises TypeError when called on a gradient colormap.

test_get_palette_raises_unknown()#

get_palette raises KeyError for an unknown colormap name.

test_get_palette_shape_and_range()#

Discrete palette is a finite (N, 3) float32 array in [0, 1].

test_make_mapper()#

make_color_mapper returns a callable producing correct output shape.

test_unknown_cmap_raises()#

Requesting an unknown colormap name raises KeyError.

test_value_to_rgb_shape_and_range_scalar()#

Scalar input yields shape (3,) float32 in [0, 1].

test_value_to_rgb_shape_vector()#

Vector input of length N yields shape (N, 3) float32.