示例#1
0
    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
示例#2
0
    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
示例#3
0
    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)
示例#4
0
    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)
示例#5
0
    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)
示例#6
0
    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
示例#7
0
    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
示例#8
0
    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
示例#9
0
    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
示例#10
0
    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
示例#11
0
    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
示例#12
0
    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)
示例#13
0
    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
示例#14
0
    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
示例#15
0
    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
示例#16
0
    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
示例#17
0
    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)
示例#18
0
    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)
示例#19
0
    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)
示例#20
0
    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)
示例#21
0
    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
示例#22
0
    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
示例#23
0
    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
示例#24
0
    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