def test_establish_colors_all_none(self): # Option 1. All parameters are set to default values from cupcake.smush.base import SmushPlotterBase p = SmushPlotterBase() p.establish_variables(self.data) p.establish_colors(**self.color_kws) assert p.n_colors == 1 assert len(p.high_dimensional_data.groupby(p.color)) == p.n_colors
def test_establish_colors_hue_order(self): # Option 2. hue_order is specified but nothing else is from cupcake.smush.base import SmushPlotterBase color_kws = self.color_kws.copy() color_kws['hue_order'] = self.order p = SmushPlotterBase() p.establish_variables(self.data) p.establish_colors(**color_kws)
def establish_colors_color_palette(self, hue, hue_order): # Option 13-16. "color", and "palette" are specified but incompatible from cupcake.smush.base import SmushPlotterBase color_kws = self.color_kws.copy() color_kws['color'] = self.color color_kws['palette'] = self.palette color_kws['hue'] = hue color_kws['hue_order'] = hue_order p = SmushPlotterBase() p.establish_variables(self.data) p.establish_colors(**color_kws)
def establish_colors_color(self): # Option 9. "color" is specified from cupcake.smush.base import SmushPlotterBase color_kws = self.color_kws.copy() color_kws['color'] = self.color p = SmushPlotterBase() p.establish_variables(self.data) p.establish_colors(**color_kws) assert p.n_colors == 1 assert len(p.high_dimensional_data.groupby(p.color)) == p.n_colors
def test_establish_colors_hue(self): # Option 3. "hue" is specified but nothing else is from cupcake.smush.base import SmushPlotterBase color_kws = self.color_kws.copy() color_kws['hue'] = self.groupby p = SmushPlotterBase() p.establish_variables(self.data) p.establish_colors(**color_kws) assert p.n_colors == 2 assert len(p.high_dimensional_data.groupby(p.color)) == p.n_colors
def establish_colors_palette(self): # Option 5. "palette" is specified but nothing else is from cupcake.smush.base import SmushPlotterBase color_kws = self.color_kws.copy() color_kws['palette'] = self.palette p = SmushPlotterBase() p.establish_variables(self.data) p.establish_colors(**color_kws) assert p.n_colors == self.nrow assert len(p.high_dimensional_data.groupby(p.color)) == p.n_colors
def establish_colors_palette_hue(self): # Option 7. "palette" and "hue" are specified from cupcake.smush.base import SmushPlotterBase color_kws = self.color_kws.copy() color_kws['palette'] = self.palette color_kws['hue'] = self.groupby p = SmushPlotterBase() p.establish_variables(self.data) p.establish_colors(**color_kws) assert p.n_colors == 2 assert len(p.high_dimensional_data.groupby(p.color)) == p.n_colors
def establish_colors_color_hue_hue_order(self): # Option 12. "color", "hue", and "hue_order" are specified from cupcake.smush.base import SmushPlotterBase color_kws = self.color_kws.copy() color_kws['color'] = self.color color_kws['hue'] = self.groupby color_kws['hue_order'] = self.order p = SmushPlotterBase() p.establish_variables(self.data) p.establish_colors(**color_kws) assert p.n_colors == 2 assert len(p.high_dimensional_data.groupby(p.color)) == p.n_colors
def establish_colors_palette_hue_order_incorrect_length(self): # Option 6b. "palette" and "hue_order" are specified, but hue_order # isn't correct length from cupcake.smush.base import SmushPlotterBase # Reverse the index order hue_order = self.data.index[::-1] hue_order = hue_order[:self.half] color_kws = self.color_kws.copy() color_kws['palette'] = self.palette color_kws['hue_order'] = hue_order p = SmushPlotterBase() p.establish_variables(self.data) p.establish_colors(**color_kws)
def establish_colors_color_hue_order_incorrect_length(self): # Option 10. "color" and "hue_order" are specified, but "hue_order" is # the incorrect length from cupcake.smush.base import SmushPlotterBase # Reverse the index so hue_order is different from original order hue_order = self.data.index[::-1] hue_order = hue_order[:self.half] color_kws = self.color_kws.copy() color_kws['color'] = self.color color_kws['hue_order'] = hue_order p = SmushPlotterBase() p.establish_variables(self.data) p.establish_colors(**color_kws)
def establish_colors_color_hue_order(self): # Option 10. "color" and "hue_order" are specified from cupcake.smush.base import SmushPlotterBase # Reverse the index so hue_order is different from original order hue_order = self.data.index[::-1] color_kws = self.color_kws.copy() color_kws['color'] = self.color color_kws['hue_order'] = hue_order p = SmushPlotterBase() p.establish_variables(self.data) p.establish_colors(**color_kws) assert p.n_colors == self.nrow assert len(p.high_dimensional_data.groupby(p.color)) == p.n_colors
def establish_colors_palette_hue_order(self): # Option 6a. "palette" and "hue_order" are specified from cupcake.smush.base import SmushPlotterBase # Reverse the index order hue_order = self.data.index[::-1] color_kws = self.color_kws.copy() color_kws['palette'] = self.palette color_kws['hue_order'] = hue_order p = SmushPlotterBase() p.establish_variables(self.data) p.establish_colors(**color_kws) assert p.n_colors == self.nrow assert len(p.high_dimensional_data.groupby(p.color)) == p.n_colors