mwaskom / seaborn

Statistical data visualization in Python
https://seaborn.pydata.org
BSD 3-Clause "New" or "Revised" License
12.51k stars 1.92k forks source link

RFE: move from husl to hsluv #2841

Closed kloczek closed 2 years ago

kloczek commented 2 years ago

Looks like husl module is no longer maintained (last release was in 2015) and instead can be used hsluv https://pypi.org/project/hsluv/ https://github.com/hsluv/hsluv-python/

mwaskom commented 2 years ago

Seaborn vendors the husl module so technically it is unaffected by this. I'm not sure there's a compelling reason to incur the churn required to change the name seaborn uses for the palette — AFAIK there are no actual bugs in the code we package.

kloczek commented 2 years ago

Issue still remains that husl is no longer maintained and looks like its code still is not cleaned to remove python 2.x bits.

mwaskom commented 2 years ago

but what is the actual problem here? the husl code just does some matrix multiplications, it's not like there is a security risk. if it exercises upstream features that get deprecated, that will turn up in the seaborn tests and we can deal with it in the vendored module.

kloczek commented 2 years ago

Issue is that husl as it still contaons python 2.x syntach thos blocks packaging of that module because it is not possible to generate python pcode files (.pyc and .po files).

mwaskom commented 2 years ago

It sounds like you're trying to do something specific, but I don't know what it is. Please be clear about what actual problem you are encountering, beyond the mere existence of Python 2.x syntax. Otherwise, it's a waste of time to update a vendored dependency that solves the problem it is meant to solve.

kloczek commented 2 years ago

I'm packaging python modules as rpm and Solaris IPS packages. Part of the packaging process is gernerate python pcode files and as I wrote python exits with error cpde when source .py file contains python 2.x syntax.

Nevertheless depend on the other modules code which is unmantained brings some elent of the risk. That risk is possible IMO to nullify by switching to alternative module which is EnoughGood™️ mantained.

mwaskom commented 2 years ago

Please provide details about the error code you are seeing.

kloczek commented 2 years ago

I alredy gave more thab one argument and each one should be enough to at leaset consider change cureent situation. Despite that yuo still want me to give you more. I have impression that whatever I'll dropp on the table you are not going to do anything and you are tryng to discourage me. At some pont it is necessary to stop .. because looks like I'm wasteing time.

If you don't like the idea just please close the ticket and I'll reuse saved time on my own migration.

mwaskom commented 2 years ago

Closing because there is no clearly defined issue here.

I alredy gave more thab one argument and each one should be enough to at leaset consider change cureent situation. Despite that yuo still want me to give you more.

What I asked for was details to support the argument you were making. If you say you are seeing an error, what error are you seeing? If you are saying that Python 2 syntax is a problem, what syntax? Why am I supposed to believe that whatever problem you are having has anything to do with the husl code?

kloczek commented 2 years ago

What I asked for was details to support the argument you were making. If you say you are seeing an error, what error are you seeing? If you are saying that Python 2 syntax is a problem, what syntax? Why am I supposed to believe that whatever problem you are having has anything to do with the husl code?

As I wrote husl is no longer maintained module. On packaging as rpm package it fails because its code contains python 2.x syntax (python 3.x refuses generate in such cases pcode).

kloczek commented 2 years ago

In mean time I've been tryng to switch to hsluv using below patch

```patch --- a/seaborn/palettes.py~ 2022-06-11 12:05:46.000000000 +0000 +++ b/seaborn/palettes.py 2022-06-11 12:12:17.646126220 +0000 @@ -4,13 +4,13 @@ import numpy as np import matplotlib as mpl -import husl +import hsluv from .utils import desaturate, get_color_cycle from .colors import xkcd_rgb, crayons -__all__ = ["color_palette", "hls_palette", "husl_palette", "mpl_palette", +__all__ = ["color_palette", "hls_palette", "hsluv_palette", "mpl_palette", "dark_palette", "light_palette", "diverging_palette", "blend_palette", "xkcd_palette", "crayon_palette", "cubehelix_palette", "set_color_codes"] @@ -96,7 +96,7 @@ Possible ``palette`` values include: - Name of a seaborn palette (deep, muted, bright, pastel, dark, colorblind) - Name of matplotlib colormap - - 'husl' or 'hls' + - 'hsluv' or 'hls' - 'ch:' - 'light:', 'dark:', 'blend:,', - A sequence of colors in any format matplotlib accepts @@ -165,9 +165,9 @@ # Evenly spaced colors in cylindrical RGB space palette = hls_palette(n_colors, as_cmap=as_cmap) - elif palette == "husl": + elif palette == "hsluv": # Evenly spaced colors in cylindrical Lab space - palette = husl_palette(n_colors, as_cmap=as_cmap) + palette = hsluv_palette(n_colors, as_cmap=as_cmap) elif palette.lower() == "jet": # Paternalism @@ -249,7 +249,7 @@ See Also -------- - husl_palette : Make a palette using evenly spaced hues in the HUSL system. + hsluv_palette : Make a palette using evenly spaced hues in the HUSL system. Examples -------- @@ -297,7 +297,7 @@ return _ColorPalette(palette) -def husl_palette(n_colors=6, h=.01, s=.9, l=.65, as_cmap=False): # noqa +def hsluv_palette(n_colors=6, h=.01, s=.9, l=.65, as_cmap=False): # noqa """Get a set of evenly spaced colors in HUSL hue space. h, s, and l should be between 0 and 1 @@ -332,28 +332,28 @@ :context: close-figs >>> import seaborn as sns; sns.set_theme() - >>> sns.palplot(sns.husl_palette(10)) + >>> sns.palplot(sns.hsluv_palette(10)) Create a palette of 10 colors that begins at a different hue value: .. plot:: :context: close-figs - >>> sns.palplot(sns.husl_palette(10, h=.5)) + >>> sns.palplot(sns.hsluv_palette(10, h=.5)) Create a palette of 10 colors that are darker than the default: .. plot:: :context: close-figs - >>> sns.palplot(sns.husl_palette(10, l=.4)) + >>> sns.palplot(sns.hsluv_palette(10, l=.4)) Create a palette of 10 colors that are less saturated than the default: .. plot:: :context: close-figs - >>> sns.palplot(sns.husl_palette(10, s=.4)) + >>> sns.palplot(sns.hsluv_palette(10, s=.4)) """ if as_cmap: @@ -364,7 +364,7 @@ hues *= 359 s *= 99 l *= 99 # noqa - palette = [_color_to_rgb((h_i, s, l), input="husl") for h_i in hues] + palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] if as_cmap: return mpl.colors.ListedColormap(palette, "hsl") else: @@ -458,8 +458,8 @@ """Add some more flexibility to color choices.""" if input == "hls": color = colorsys.hls_to_rgb(*color) - elif input == "husl": - color = husl.husl_to_rgb(*color) + elif input == "hsluv": + color = hsluv.hsluv_to_rgb(*color) color = tuple(np.clip(color, 0, 1)) elif input == "xkcd": color = xkcd_rgb[color] @@ -491,7 +491,7 @@ if True, reverse the direction of the blend as_cmap : bool, optional If True, return a :class:`matplotlib.colors.Colormap`. - input : {'rgb', 'hls', 'husl', xkcd'} + input : {'rgb', 'hls', 'hsluv', xkcd'} Color space to interpret the input color. The first three options apply to tuple inputs and the latter applies to string inputs. @@ -527,7 +527,7 @@ .. plot:: :context: close-figs - >>> sns.palplot(sns.dark_palette((260, 75, 60), input="husl")) + >>> sns.palplot(sns.dark_palette((260, 75, 60), input="hsluv")) Generate a colormap object: @@ -541,9 +541,9 @@ """ rgb = _color_to_rgb(color, input) - h, s, l = husl.rgb_to_husl(*rgb) + h, s, l = hsluv.rgb_to_hsluv(*rgb) gray_s, gray_l = .15 * s, 15 - gray = _color_to_rgb((h, gray_s, gray_l), input="husl") + gray = _color_to_rgb((h, gray_s, gray_l), input="hsluv") colors = [rgb, gray] if reverse else [gray, rgb] return blend_palette(colors, n_colors, as_cmap) @@ -572,7 +572,7 @@ if True, reverse the direction of the blend as_cmap : bool, optional If True, return a :class:`matplotlib.colors.Colormap`. - input : {'rgb', 'hls', 'husl', xkcd'} + input : {'rgb', 'hls', 'hsluv', xkcd'} Color space to interpret the input color. The first three options apply to tuple inputs and the latter applies to string inputs. @@ -608,7 +608,7 @@ .. plot:: :context: close-figs - >>> sns.palplot(sns.light_palette((260, 75, 60), input="husl")) + >>> sns.palplot(sns.light_palette((260, 75, 60), input="hsluv")) Generate a colormap object: @@ -622,9 +622,9 @@ """ rgb = _color_to_rgb(color, input) - h, s, l = husl.rgb_to_husl(*rgb) + h, s, l = hsluv.rgb_to_hsluv(*rgb) gray_s, gray_l = .15 * s, 95 - gray = _color_to_rgb((h, gray_s, gray_l), input="husl") + gray = _color_to_rgb((h, gray_s, gray_l), input="hsluv") colors = [rgb, gray] if reverse else [gray, rgb] return blend_palette(colors, n_colors, as_cmap) @@ -701,8 +701,8 @@ """ palfunc = dict(dark=dark_palette, light=light_palette)[center] n_half = int(128 - (sep // 2)) - neg = palfunc((h_neg, s, l), n_half, reverse=True, input="husl") - pos = palfunc((h_pos, s, l), n_half, input="husl") + neg = palfunc((h_neg, s, l), n_half, reverse=True, input="hsluv") + pos = palfunc((h_pos, s, l), n_half, input="hsluv") midpoint = dict(light=[(.95, .95, .95)], dark=[(.133, .133, .133)])[center] mid = midpoint * sep pal = blend_palette(np.concatenate([neg, mid, pos]), n, as_cmap=as_cmap) --- a/seaborn/distributions.py~ 2022-06-11 12:05:46.000000000 +0000 +++ b/seaborn/distributions.py 2022-06-11 12:12:12.862125362 +0000 @@ -33,7 +33,7 @@ _assign_default_kwargs, ) from .palettes import color_palette -import husl +import hsluv from ._decorators import _deprecate_positional_args from ._docstrings import ( DocstringComponents, @@ -192,13 +192,13 @@ # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) - h, s, _ = husl.rgb_to_husl(r, g, b) + h, s, _ = hsluv.rgb_to_hsluv(r, g, b) xx = np.linspace(-1, 1, int(1.15 * 256))[:256] ramp = np.zeros((256, 3)) ramp[:, 0] = h ramp[:, 1] = s * np.cos(xx) ramp[:, 2] = np.linspace(35, 80, 256) - colors = np.clip([husl.husl_to_rgb(*hsl) for hsl in ramp], 0, 1) + colors = np.clip([hsluv.hsluv_to_rgb(*hsl) for hsl in ramp], 0, 1) return mpl.colors.ListedColormap(colors[::-1]) def _default_discrete(self): --- a/seaborn/widgets.py~ 2021-08-15 22:38:45.000000000 +0000 +++ b/seaborn/widgets.py 2022-06-11 12:12:08.103124507 +0000 @@ -154,7 +154,7 @@ return pal -def choose_dark_palette(input="husl", as_cmap=False): +def choose_dark_palette(input="hsluv", as_cmap=False): """Launch an interactive widget to create a dark sequential palette. This corresponds with the :func:`dark_palette` function. This kind @@ -165,7 +165,7 @@ Parameters ---------- - input : {'husl', 'hls', 'rgb'} + input : {'hsluv', 'hls', 'rgb'} Color space for defining the seed value. Note that the default is different than the default input for :func:`dark_palette`. as_cmap : bool @@ -219,19 +219,19 @@ pal[:] = dark_palette(color, n, input="hls") palplot(pal) - elif input == "husl": + elif input == "hsluv": @interact - def choose_dark_palette_husl(h=(0, 359), + def choose_dark_palette_hsluv(h=(0, 359), s=(0, 99), l=(0, 99), # noqa: E741 n=(3, 17)): color = h, s, l if as_cmap: - colors = dark_palette(color, 256, input="husl") + colors = dark_palette(color, 256, input="hsluv") _update_lut(cmap, colors) _show_cmap(cmap) else: - pal[:] = dark_palette(color, n, input="husl") + pal[:] = dark_palette(color, n, input="hsluv") palplot(pal) if as_cmap: @@ -239,7 +239,7 @@ return pal -def choose_light_palette(input="husl", as_cmap=False): +def choose_light_palette(input="hsluv", as_cmap=False): """Launch an interactive widget to create a light sequential palette. This corresponds with the :func:`light_palette` function. This kind @@ -250,7 +250,7 @@ Parameters ---------- - input : {'husl', 'hls', 'rgb'} + input : {'hsluv', 'hls', 'rgb'} Color space for defining the seed value. Note that the default is different than the default input for :func:`light_palette`. as_cmap : bool @@ -304,19 +304,19 @@ pal[:] = light_palette(color, n, input="hls") palplot(pal) - elif input == "husl": + elif input == "hsluv": @interact - def choose_light_palette_husl(h=(0, 359), + def choose_light_palette_hsluv(h=(0, 359), s=(0, 99), l=(0, 99), # noqa: E741 n=(3, 17)): color = h, s, l if as_cmap: - colors = light_palette(color, 256, input="husl") + colors = light_palette(color, 256, input="hsluv") _update_lut(cmap, colors) _show_cmap(cmap) else: - pal[:] = light_palette(color, n, input="husl") + pal[:] = light_palette(color, n, input="hsluv") palplot(pal) if as_cmap: --- a/seaborn/rcmod.py~ 2021-08-15 22:38:45.000000000 +0000 +++ b/seaborn/rcmod.py 2022-06-11 12:11:33.676118334 +0000 @@ -512,7 +512,7 @@ Parameters ---------- - palette : seaborn color paltte | matplotlib colormap | hls | husl + palette : seaborn color paltte | matplotlib colormap | hls | hsluv Palette definition. Should be something that :func:`color_palette` can process. n_colors : int --- a/seaborn/categorical.py~ 2021-08-15 22:38:45.000000000 +0000 +++ b/seaborn/categorical.py 2022-06-11 12:11:29.233117537 +0000 @@ -15,7 +15,7 @@ from . import utils from .utils import remove_na from .algorithms import bootstrap -from .palettes import color_palette, husl_palette, light_palette, dark_palette +from .palettes import color_palette, hsluv_palette, light_palette, dark_palette from .axisgrid import FacetGrid, _facet_docs from ._decorators import _deprecate_positional_args @@ -274,12 +274,12 @@ # Determine the main colors if color is None and palette is None: # Determine whether the current palette will have enough values - # If not, we'll default to the husl palette so each is distinct + # If not, we'll default to the hsluv palette so each is distinct current_palette = utils.get_color_cycle() if n_colors <= len(current_palette): colors = color_palette(n_colors=n_colors) else: - colors = husl_palette(n_colors, l=.7) # noqa + colors = hsluv_palette(n_colors, l=.7) # noqa elif palette is None: # When passing a specific color, the interpretation depends --- a/seaborn/axisgrid.py~ 2021-08-15 22:38:45.000000000 +0000 +++ b/seaborn/axisgrid.py 2022-06-11 12:11:13.672114746 +0000 @@ -229,7 +229,7 @@ if palette is None: current_palette = utils.get_color_cycle() if n_colors > len(current_palette): - colors = color_palette("husl", n_colors) + colors = color_palette("hsluv", n_colors) else: colors = color_palette(n_colors=n_colors) --- a/seaborn/_core.py~ 2021-08-15 22:38:45.000000000 +0000 +++ b/seaborn/_core.py 2022-06-11 12:11:06.901113532 +0000 @@ -197,7 +197,7 @@ if n_colors <= len(get_color_cycle()): colors = color_palette(None, n_colors) else: - colors = color_palette("husl", n_colors) + colors = color_palette("hsluv", n_colors) elif isinstance(palette, list): if len(palette) != n_colors: err = "The palette list has the wrong number of colors." --- a/seaborn/tests/test_palettes.py~ 2022-06-11 12:05:46.000000000 +0000 +++ b/seaborn/tests/test_palettes.py 2022-06-11 12:12:03.934123762 +0000 @@ -6,7 +6,7 @@ import numpy.testing as npt from .. import palettes, utils, rcmod -import husl +import hsluv from ..colors import xkcd_rgb, crayons @@ -32,7 +32,7 @@ def test_big_palette_context(self): original_pal = palettes.color_palette("deep", n_colors=8) - context_pal = palettes.color_palette("husl", 10) + context_pal = palettes.color_palette("hsluv", 10) rcmod.set_palette(original_pal) with palettes.color_palette(context_pal, 10): @@ -54,7 +54,7 @@ pal = palettes.color_palette("Set3") assert len(pal) == palettes.QUAL_PALETTE_SIZES["Set3"] - pal = palettes.color_palette("husl") + pal = palettes.color_palette("hsluv") assert len(pal) == 6 pal = palettes.color_palette("Greens") @@ -79,14 +79,14 @@ cmap2 = palettes.color_palette("hls", as_cmap=True) npt.assert_array_equal(cmap1([.2, .8]), cmap2([.2, .8])) - def test_husl_palette(self): + def test_hsluv_palette(self): - pal1 = palettes.husl_palette() - pal2 = palettes.color_palette("husl") + pal1 = palettes.hsluv_palette() + pal2 = palettes.color_palette("hsluv") npt.assert_array_equal(pal1, pal2) - cmap1 = palettes.husl_palette(as_cmap=True) - cmap2 = palettes.color_palette("husl", as_cmap=True) + cmap1 = palettes.hsluv_palette(as_cmap=True) + cmap2 = palettes.color_palette("hsluv", as_cmap=True) npt.assert_array_equal(cmap1([.2, .8]), cmap2([.2, .8])) def test_mpl_palette(self): @@ -129,9 +129,9 @@ def test_palette_desat(self): - pal1 = palettes.husl_palette(6) + pal1 = palettes.hsluv_palette(6) pal1 = [utils.desaturate(c, .5) for c in pal1] - pal2 = palettes.color_palette("husl", desat=.5) + pal2 = palettes.color_palette("hsluv", desat=.5) npt.assert_array_equal(pal1, pal2) def test_palette_is_list_of_tuples(self): @@ -167,20 +167,20 @@ npt.assert_array_less(list(map(np.std, pal_flat)), list(map(np.std, pal_bold))) - def test_husl_values(self): + def test_hsluv_values(self): - pal1 = palettes.husl_palette(6, h=0) - pal2 = palettes.husl_palette(6, h=.5) + pal1 = palettes.hsluv_palette(6, h=0) + pal2 = palettes.hsluv_palette(6, h=.5) pal2 = pal2[3:] + pal2[:3] npt.assert_array_almost_equal(pal1, pal2) - pal_dark = palettes.husl_palette(5, l=.2) # noqa - pal_bright = palettes.husl_palette(5, l=.8) # noqa + pal_dark = palettes.hsluv_palette(5, l=.2) # noqa + pal_bright = palettes.hsluv_palette(5, l=.8) # noqa npt.assert_array_less(list(map(sum, pal_dark)), list(map(sum, pal_bright))) - pal_flat = palettes.husl_palette(5, s=.1) - pal_bold = palettes.husl_palette(5, s=.9) + pal_flat = palettes.hsluv_palette(5, s=.1) + pal_bold = palettes.hsluv_palette(5, s=.9) npt.assert_array_less(list(map(np.std, pal_flat)), list(map(np.std, pal_bold))) @@ -207,16 +207,16 @@ rgb_want = colorsys.hls_to_rgb(*color) assert rgb_got == rgb_want - def test_rgb_from_husl(self): + def test_rgb_from_hsluv(self): color = 120, 50, 40 - rgb_got = palettes._color_to_rgb(color, "husl") - rgb_want = tuple(husl.husl_to_rgb(*color)) + rgb_got = palettes._color_to_rgb(color, "hsluv") + rgb_want = tuple(hsluv.hsluv_to_rgb(*color)) assert rgb_got == rgb_want for h in range(0, 360): color = h, 100, 100 - rgb = palettes._color_to_rgb(color, "husl") + rgb = palettes._color_to_rgb(color, "hsluv") assert min(rgb) >= 0 assert max(rgb) <= 1 @@ -288,9 +288,9 @@ n = 12 pal = palettes.diverging_palette(*args, n=n) neg_pal = palettes.light_palette((h_neg, sat, lum), int(n // 2), - input="husl") + input="hsluv") pos_pal = palettes.light_palette((h_pos, sat, lum), int(n // 2), - input="husl") + input="hsluv") assert len(pal) == n assert pal[0] == neg_pal[-1] assert pal[-1] == pos_pal[-1] --- a/seaborn/tests/test_miscplot.py~ 2021-08-15 22:38:45.000000000 +0000 +++ b/seaborn/tests/test_miscplot.py 2022-06-11 12:11:54.840122128 +0000 @@ -9,17 +9,17 @@ """Test the function that visualizes a color palette.""" def test_palplot_size(self): - pal4 = color_palette("husl", 4) + pal4 = color_palette("hsluv", 4) misc.palplot(pal4) size4 = plt.gcf().get_size_inches() assert tuple(size4) == (4, 1) - pal5 = color_palette("husl", 5) + pal5 = color_palette("hsluv", 5) misc.palplot(pal5) size5 = plt.gcf().get_size_inches() assert tuple(size5) == (5, 1) - palbig = color_palette("husl", 3) + palbig = color_palette("hsluv", 3) misc.palplot(palbig, 2) sizebig = plt.gcf().get_size_inches() assert tuple(sizebig) == (6, 2) --- a/seaborn/tests/test_core.py~ 2021-08-15 22:38:45.000000000 +0000 +++ b/seaborn/tests/test_core.py 2022-06-11 12:11:50.298121316 +0000 @@ -169,7 +169,7 @@ hue = pd.Series(list("abcdefghijklmnopqrstuvwxyz")) p = VectorPlotter(variables=dict(x=x, y=y, hue=hue)) m = HueMapping(p) - expected_colors = color_palette("husl", n_colors=len(hue)) + expected_colors = color_palette("hsluv", n_colors=len(hue)) expected_lookup_table = dict(zip(hue, expected_colors)) assert m.lookup_table == expected_lookup_table --- a/seaborn/tests/test_categorical.py~ 2021-08-15 22:38:45.000000000 +0000 +++ b/seaborn/tests/test_categorical.py 2022-06-11 12:11:43.387120076 +0000 @@ -363,7 +363,7 @@ p.establish_variables("g", "y", data=self.df) p.establish_colors(None, None, 1) npt.assert_array_equal(p.colors, - palettes.husl_palette(3, l=.7)) # noqa + palettes.hsluv_palette(3, l=.7)) # noqa def test_specific_color(self): --- a/seaborn/tests/test_axisgrid.py~ 2021-08-15 22:38:45.000000000 +0000 +++ b/seaborn/tests/test_axisgrid.py 2022-06-11 12:11:39.289119342 +0000 @@ -598,7 +598,7 @@ assert g._colors == color_palette(n_colors=len(self.df.c.unique())) g = ag.FacetGrid(self.df, hue="d") - assert g._colors == color_palette("husl", len(self.df.d.unique())) + assert g._colors == color_palette("hsluv", len(self.df.d.unique())) g = ag.FacetGrid(self.df, hue="c", palette="Set2") assert g._colors == color_palette("Set2", len(self.df.c.unique())) @@ -1053,7 +1053,7 @@ assert g.palette == color_palette(n_colors=len(self.df.a.unique())) g = ag.PairGrid(self.df, hue="b") - assert g.palette == color_palette("husl", len(self.df.b.unique())) + assert g.palette == color_palette("hsluv", len(self.df.b.unique())) g = ag.PairGrid(self.df, hue="a", palette="Set2") assert g.palette == color_palette("Set2", len(self.df.a.unique())) ```

however looks like there are some API changes so above is not enough and pytest is failing

```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-seaborn-0.11.2-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-seaborn-0.11.2-2.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra -p no:cacheprovider seaborn =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0 rootdir: /home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2, configfile: pytest.ini collected 1048 items seaborn/tests/test_algorithms.py ............ssssss [ 1%] seaborn/tests/test_axisgrid.py ...............................F............F..................F......F.....F..........................F.......... [ 12%] seaborn/tests/test_categorical.py ..............FF................F.FF.....................................................................F........................ [ 25%] .......F....... [ 26%] seaborn/tests/test_core.py .....F..........................................sss............ [ 32%] seaborn/tests/test_decorators.py ... [ 32%] seaborn/tests/test_distributions.py ...............................................................F..FFFFFFFFFF.................................................... [ 44%] .........................FFFFFFFFFFFFFFFF..............................F......................FFF...........FF. [ 55%] seaborn/tests/test_docstrings.py .... [ 55%] seaborn/tests/test_matrix.py .............................................ss.......................................... [ 64%] seaborn/tests/test_miscplot.py F. [ 64%] seaborn/tests/test_palettes.py ..FF..F.....F...F...F.FFF............ [ 68%] seaborn/tests/test_rcmod.py ....................s.s [ 70%] seaborn/tests/test_regression.py ................ss.ss.........ssss...................s.. [ 75%] seaborn/tests/test_relational.py ..............................................................................................................F......F............. [ 88%] ....F.................... [ 90%] seaborn/tests/test_statistics.py .............................................s.. [ 95%] seaborn/tests/test_utils.py ................................................... [100%] ================================================================================= FAILURES ================================================================================= ________________________________________________________________________ TestFacetGrid.test_palette ________________________________________________________________________ self = def test_palette(self): rcmod.set() g = ag.FacetGrid(self.df, hue="c") assert g._colors == color_palette(n_colors=len(self.df.c.unique())) > g = ag.FacetGrid(self.df, hue="d") seaborn/tests/test_axisgrid.py:600: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/_decorators.py:46: in inner_f return f(**kwargs) seaborn/axisgrid.py:346: in __init__ colors = self._get_palette(data, hue, hue_order, palette) seaborn/axisgrid.py:232: in _get_palette colors = color_palette("hsluv", n_colors) seaborn/palettes.py:170: in color_palette palette = hsluv_palette(n_colors, as_cmap=as_cmap) seaborn/palettes.py:367: in hsluv_palette palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:367: in palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:462: in _color_to_rgb color = hsluv.hsluv_to_rgb(*color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (3.59, 89.10000000000001, 64.35000000000001), kwargs = {} @_wraps(conversion) def normalized(*args, **kwargs): > color = conversion(*args, **kwargs) E TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given /usr/lib/python3.8/site-packages/hsluv.py:33: TypeError ________________________________________________________________ TestPairGrid.test_remove_hue_from_default _________________________________________________________________ self = def test_remove_hue_from_default(self): hue = "z" > g = ag.PairGrid(self.df, hue=hue) seaborn/tests/test_axisgrid.py:731: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/_decorators.py:46: in inner_f return f(**kwargs) seaborn/axisgrid.py:1301: in __init__ self.palette = self._get_palette(data, hue, hue_order, palette) seaborn/axisgrid.py:232: in _get_palette colors = color_palette("hsluv", n_colors) seaborn/palettes.py:170: in color_palette palette = hsluv_palette(n_colors, as_cmap=as_cmap) seaborn/palettes.py:367: in hsluv_palette palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:367: in palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:462: in _color_to_rgb color = hsluv.hsluv_to_rgb(*color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (3.59, 89.10000000000001, 64.35000000000001), kwargs = {} @_wraps(conversion) def normalized(*args, **kwargs): > color = conversion(*args, **kwargs) E TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given /usr/lib/python3.8/site-packages/hsluv.py:33: TypeError ________________________________________________________________________ TestPairGrid.test_palette _________________________________________________________________________ self = def test_palette(self): rcmod.set() g = ag.PairGrid(self.df, hue="a") assert g.palette == color_palette(n_colors=len(self.df.a.unique())) > g = ag.PairGrid(self.df, hue="b") seaborn/tests/test_axisgrid.py:1055: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/_decorators.py:46: in inner_f return f(**kwargs) seaborn/axisgrid.py:1301: in __init__ self.palette = self._get_palette(data, hue, hue_order, palette) seaborn/axisgrid.py:232: in _get_palette colors = color_palette("hsluv", n_colors) seaborn/palettes.py:170: in color_palette palette = hsluv_palette(n_colors, as_cmap=as_cmap) seaborn/palettes.py:367: in hsluv_palette palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:367: in palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:462: in _color_to_rgb color = hsluv.hsluv_to_rgb(*color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (3.59, 89.10000000000001, 64.35000000000001), kwargs = {} @_wraps(conversion) def normalized(*args, **kwargs): > color = conversion(*args, **kwargs) E TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given /usr/lib/python3.8/site-packages/hsluv.py:33: TypeError ____________________________________________________________________ TestPairGrid.test_histplot_legend _____________________________________________________________________ self = def test_histplot_legend(self): # Tests _extract_legend_handles g = ag.PairGrid(self.df, vars=["x", "y"], hue="a") > g.map_offdiag(histplot) seaborn/tests/test_axisgrid.py:1236: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/axisgrid.py:1387: in map_offdiag self.map_lower(func, **kwargs) seaborn/axisgrid.py:1357: in map_lower self._map_bivariate(func, indices, **kwargs) seaborn/axisgrid.py:1539: in _map_bivariate self._plot_bivariate(x_var, y_var, ax, func, **kws) seaborn/axisgrid.py:1579: in _plot_bivariate func(x=x, y=y, **kwargs) seaborn/distributions.py:1480: in histplot p.plot_bivariate_histogram( seaborn/distributions.py:819: in plot_bivariate_histogram cmap = self._cmap_from_color(color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = (0.2980392156862745, 0.4470588235294118, 0.6901960784313725) def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError _____________________________________________________________________ TestPairGrid.test_pairplot_hist ______________________________________________________________________ self = def test_pairplot_hist(self): f, ax1 = plt.subplots() > histplot(data=self.df, x="x", y="y", ax=ax1) seaborn/tests/test_axisgrid.py:1364: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/distributions.py:1480: in histplot p.plot_bivariate_histogram( seaborn/distributions.py:826: in plot_bivariate_histogram cmap = self._cmap_from_color(color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = 'C0' def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError _________________________________________________________________________ TestJointPlot.test_hist __________________________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] def test_hist(self, long_df): bins = 3, 6 > g1 = ag.jointplot(data=long_df, x="x", y="y", kind="hist", bins=bins) seaborn/tests/test_axisgrid.py:1680: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/_decorators.py:46: in inner_f return f(**kwargs) seaborn/axisgrid.py:2262: in jointplot grid.plot_joint(histplot, **joint_kws) seaborn/axisgrid.py:1806: in plot_joint func(x=self.x, y=self.y, **kwargs) seaborn/distributions.py:1480: in histplot p.plot_bivariate_histogram( seaborn/distributions.py:826: in plot_bivariate_histogram cmap = self._cmap_from_color(color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = 'C0' def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError _______________________________________________________ TestCategoricalPlotter.test_default_palette_with_many_levels _______________________________________________________ self = def test_default_palette_with_many_levels(self): with palettes.color_palette(["blue", "red"], 2): p = cat._CategoricalPlotter() p.establish_variables("g", "y", data=self.df) > p.establish_colors(None, None, 1) seaborn/tests/test_categorical.py:364: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/categorical.py:282: in establish_colors colors = hsluv_palette(n_colors, l=.7) # noqa seaborn/palettes.py:367: in hsluv_palette palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:367: in palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:462: in _color_to_rgb color = hsluv.hsluv_to_rgb(*color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (3.59, 89.10000000000001, 69.3), kwargs = {} @_wraps(conversion) def normalized(*args, **kwargs): > color = conversion(*args, **kwargs) E TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given /usr/lib/python3.8/site-packages/hsluv.py:33: TypeError ________________________________________________________________ TestCategoricalPlotter.test_specific_color ________________________________________________________________ self = def test_specific_color(self): p = cat._CategoricalPlotter() # Test the same color for each x position p.establish_variables("g", "y", data=self.df) p.establish_colors("blue", None, 1) blue_rgb = mpl.colors.colorConverter.to_rgb("blue") assert p.colors == [blue_rgb] * 3 # Test a color-based blend for the hue mapping p.establish_variables("g", "y", hue="h", data=self.df) > p.establish_colors("#ff0022", None, 1) seaborn/tests/test_categorical.py:380: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/categorical.py:293: in establish_colors colors = light_palette(color, n_colors) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ color = '#ff0022', n_colors = 2, reverse = False, as_cmap = False, input = 'rgb' def light_palette(color, n_colors=6, reverse=False, as_cmap=False, input="rgb"): """Make a sequential palette that blends from light to ``color``. This kind of palette is good for data that range between relatively uninteresting low values and interesting high values. The ``color`` parameter can be specified in a number of ways, including all options for defining a color in matplotlib and several additional color spaces that are handled by seaborn. You can also use the database of named colors from the XKCD color survey. If you are using the IPython notebook, you can also choose this palette interactively with the :func:`choose_light_palette` function. Parameters ---------- color : base color for high values hex code, html color name, or tuple in ``input`` space. n_colors : int, optional number of colors in the palette reverse : bool, optional if True, reverse the direction of the blend as_cmap : bool, optional If True, return a :class:`matplotlib.colors.Colormap`. input : {'rgb', 'hls', 'hsluv', xkcd'} Color space to interpret the input color. The first three options apply to tuple inputs and the latter applies to string inputs. Returns ------- list of RGB tuples or :class:`matplotlib.colors.Colormap` See Also -------- dark_palette : Create a sequential palette with dark low values. diverging_palette : Create a diverging palette with two colors. Examples -------- Generate a palette from an HTML color: .. plot:: :context: close-figs >>> import seaborn as sns; sns.set_theme() >>> sns.palplot(sns.light_palette("purple")) Generate a palette that increases in lightness: .. plot:: :context: close-figs >>> sns.palplot(sns.light_palette("seagreen", reverse=True)) Generate a palette from an HUSL-space seed: .. plot:: :context: close-figs >>> sns.palplot(sns.light_palette((260, 75, 60), input="hsluv")) Generate a colormap object: .. plot:: :context: close-figs >>> from numpy import arange >>> x = arange(25).reshape(5, 5) >>> cmap = sns.light_palette("#2ecc71", as_cmap=True) >>> ax = sns.heatmap(x, cmap=cmap) """ rgb = _color_to_rgb(color, input) > h, s, l = hsluv.rgb_to_hsluv(*rgb) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/palettes.py:625: TypeError ______________________________________________________________________ TestBoxPlotter.test_axes_data _______________________________________________________________________ self = def test_axes_data(self): ax = cat.boxplot(x="g", y="y", data=self.df) > assert len(ax.artists) == 3 E AssertionError: assert 0 == 3 E + where 0 = len() E + where = .artists seaborn/tests/test_categorical.py:775: AssertionError __________________________________________________________________ TestBoxPlotter.test_draw_missing_boxes __________________________________________________________________ self = def test_draw_missing_boxes(self): ax = cat.boxplot(x="g", y="y", data=self.df, order=["a", "b", "c", "d"]) > assert len(ax.artists) == 3 E AssertionError: assert 0 == 3 E + where 0 = len() E + where = .artists seaborn/tests/test_categorical.py:804: AssertionError _____________________________________________________________________ TestBoxPlotter.test_missing_data _____________________________________________________________________ self = def test_missing_data(self): x = ["a", "a", "b", "b", "c", "c", "d", "d"] h = ["x", "y", "x", "y", "x", "y", "x", "y"] y = self.rs.randn(8) y[-2:] = np.nan ax = cat.boxplot(x=x, y=y) > assert len(ax.artists) == 3 E assert 0 == 3 E + where 0 = len() E + where = .artists seaborn/tests/test_categorical.py:814: AssertionError ______________________________________________________________________ TestCatPlot.test_plot_elements ______________________________________________________________________ self = def test_plot_elements(self): g = cat.catplot(x="g", y="y", data=self.df, kind="point") assert len(g.ax.collections) == 1 want_lines = self.g.unique().size + 1 assert len(g.ax.lines) == want_lines g = cat.catplot(x="g", y="y", hue="h", data=self.df, kind="point") want_collections = self.h.unique().size assert len(g.ax.collections) == want_collections want_lines = (self.g.unique().size + 1) * self.h.unique().size assert len(g.ax.lines) == want_lines g = cat.catplot(x="g", y="y", data=self.df, kind="bar") want_elements = self.g.unique().size assert len(g.ax.patches) == want_elements assert len(g.ax.lines) == want_elements g = cat.catplot(x="g", y="y", hue="h", data=self.df, kind="bar") want_elements = self.g.unique().size * self.h.unique().size assert len(g.ax.patches) == want_elements assert len(g.ax.lines) == want_elements g = cat.catplot(x="g", data=self.df, kind="count") want_elements = self.g.unique().size assert len(g.ax.patches) == want_elements assert len(g.ax.lines) == 0 g = cat.catplot(x="g", hue="h", data=self.df, kind="count") want_elements = self.g.unique().size * self.h.unique().size assert len(g.ax.patches) == want_elements assert len(g.ax.lines) == 0 g = cat.catplot(x="g", y="y", data=self.df, kind="box") want_artists = self.g.unique().size > assert len(g.ax.artists) == want_artists E AssertionError: assert 0 == 3 E + where 0 = len() E + where = .artists E + where = .ax seaborn/tests/test_categorical.py:2507: AssertionError _____________________________________________________________________ TestBoxenPlotter.test_boxenplots _____________________________________________________________________ self = def test_boxenplots(self): # Smoke test the high level boxenplot options cat.boxenplot(x="y", data=self.df) plt.close("all") cat.boxenplot(y="y", data=self.df) plt.close("all") cat.boxenplot(x="g", y="y", data=self.df) plt.close("all") cat.boxenplot(x="y", y="g", data=self.df, orient="h") plt.close("all") cat.boxenplot(x="g", y="y", hue="h", data=self.df) plt.close("all") for scale in ("linear", "area", "exponential"): cat.boxenplot(x="g", y="y", hue="h", scale=scale, data=self.df) plt.close("all") for depth in ("proportion", "tukey", "trustworthy"): cat.boxenplot(x="g", y="y", hue="h", k_depth=depth, data=self.df) plt.close("all") order = list("nabc") cat.boxenplot(x="g", y="y", hue="h", order=order, data=self.df) plt.close("all") order = list("omn") cat.boxenplot(x="g", y="y", hue="h", hue_order=order, data=self.df) plt.close("all") cat.boxenplot(x="y", y="g", hue="h", data=self.df, orient="h") plt.close("all") cat.boxenplot(x="y", y="g", hue="h", data=self.df, orient="h", palette="Set2") plt.close("all") > cat.boxenplot(x="y", y="g", hue="h", data=self.df, orient="h", color="b") seaborn/tests/test_categorical.py:2959: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/_decorators.py:46: in inner_f return f(**kwargs) seaborn/categorical.py:2634: in boxenplot plotter = _LVPlotter(x, y, hue, data, order, hue_order, seaborn/categorical.py:1839: in __init__ self.establish_colors(color, palette, saturation) seaborn/categorical.py:293: in establish_colors colors = light_palette(color, n_colors) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ color = 'b', n_colors = 2, reverse = False, as_cmap = False, input = 'rgb' def light_palette(color, n_colors=6, reverse=False, as_cmap=False, input="rgb"): """Make a sequential palette that blends from light to ``color``. This kind of palette is good for data that range between relatively uninteresting low values and interesting high values. The ``color`` parameter can be specified in a number of ways, including all options for defining a color in matplotlib and several additional color spaces that are handled by seaborn. You can also use the database of named colors from the XKCD color survey. If you are using the IPython notebook, you can also choose this palette interactively with the :func:`choose_light_palette` function. Parameters ---------- color : base color for high values hex code, html color name, or tuple in ``input`` space. n_colors : int, optional number of colors in the palette reverse : bool, optional if True, reverse the direction of the blend as_cmap : bool, optional If True, return a :class:`matplotlib.colors.Colormap`. input : {'rgb', 'hls', 'hsluv', xkcd'} Color space to interpret the input color. The first three options apply to tuple inputs and the latter applies to string inputs. Returns ------- list of RGB tuples or :class:`matplotlib.colors.Colormap` See Also -------- dark_palette : Create a sequential palette with dark low values. diverging_palette : Create a diverging palette with two colors. Examples -------- Generate a palette from an HTML color: .. plot:: :context: close-figs >>> import seaborn as sns; sns.set_theme() >>> sns.palplot(sns.light_palette("purple")) Generate a palette that increases in lightness: .. plot:: :context: close-figs >>> sns.palplot(sns.light_palette("seagreen", reverse=True)) Generate a palette from an HUSL-space seed: .. plot:: :context: close-figs >>> sns.palplot(sns.light_palette((260, 75, 60), input="hsluv")) Generate a colormap object: .. plot:: :context: close-figs >>> from numpy import arange >>> x = arange(25).reshape(5, 5) >>> cmap = sns.light_palette("#2ecc71", as_cmap=True) >>> ax = sns.heatmap(x, cmap=cmap) """ rgb = _color_to_rgb(color, input) > h, s, l = hsluv.rgb_to_hsluv(*rgb) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/palettes.py:625: TypeError _________________________________________________________________ TestHueMapping.test_hue_map_categorical __________________________________________________________________ self = wide_df = a b c wide_index 10 1.449377 0.547052 -1.23... -0.305246 -1.329569 0.624981 46 0.272567 -0.936631 -0.986104 48 0.813041 -1.076465 0.829330 long_df = x y z a b c t s f a_cat s_cat s_str 0 3 0.248016 1.158338 b o 0 2004-01-0...0.3 c 2 2 99 11 -0.802590 5.748762 a p 0 2004-01-01 8 0.2 a 8 8 [100 rows x 12 columns] def test_hue_map_categorical(self, wide_df, long_df): p = VectorPlotter(data=wide_df) m = HueMapping(p) assert m.levels == wide_df.columns.tolist() assert m.map_type == "categorical" assert m.cmap is None # Test named palette palette = "Blues" expected_colors = color_palette(palette, wide_df.shape[1]) expected_lookup_table = dict(zip(wide_df.columns, expected_colors)) m = HueMapping(p, palette=palette) assert m.palette == "Blues" assert m.lookup_table == expected_lookup_table # Test list palette palette = color_palette("Reds", wide_df.shape[1]) expected_lookup_table = dict(zip(wide_df.columns, palette)) m = HueMapping(p, palette=palette) assert m.palette == palette assert m.lookup_table == expected_lookup_table # Test dict palette colors = color_palette("Set1", 8) palette = dict(zip(wide_df.columns, colors)) m = HueMapping(p, palette=palette) assert m.palette == palette assert m.lookup_table == palette # Test dict with missing keys palette = dict(zip(wide_df.columns[:-1], colors)) with pytest.raises(ValueError): HueMapping(p, palette=palette) # Test dict with missing keys palette = dict(zip(wide_df.columns[:-1], colors)) with pytest.raises(ValueError): HueMapping(p, palette=palette) # Test list with wrong number of colors palette = colors[:-1] with pytest.raises(ValueError): HueMapping(p, palette=palette) # Test hue order hue_order = ["a", "c", "d"] m = HueMapping(p, order=hue_order) assert m.levels == hue_order # Test long data p = VectorPlotter(data=long_df, variables=dict(x="x", y="y", hue="a")) m = HueMapping(p) assert m.levels == categorical_order(long_df["a"]) assert m.map_type == "categorical" assert m.cmap is None # Test default palette m = HueMapping(p) hue_levels = categorical_order(long_df["a"]) expected_colors = color_palette(n_colors=len(hue_levels)) expected_lookup_table = dict(zip(hue_levels, expected_colors)) assert m.lookup_table == expected_lookup_table # Test missing data m = HueMapping(p) assert m(np.nan) == (0, 0, 0, 0) # Test default palette with many levels x = y = np.arange(26) hue = pd.Series(list("abcdefghijklmnopqrstuvwxyz")) > p = VectorPlotter(variables=dict(x=x, y=y, hue=hue)) seaborn/tests/test_core.py:170: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/_core.py:614: in __init__ getattr(self, f"map_{var}")() seaborn/_core.py:53: in map setattr(plotter, method_name, cls(plotter, *args, **kwargs)) seaborn/_core.py:118: in __init__ levels, lookup_table = self.categorical_mapping( seaborn/_core.py:200: in categorical_mapping colors = color_palette("hsluv", n_colors) seaborn/palettes.py:170: in color_palette palette = hsluv_palette(n_colors, as_cmap=as_cmap) seaborn/palettes.py:367: in hsluv_palette palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:367: in palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:462: in _color_to_rgb color = hsluv.hsluv_to_rgb(*color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (3.59, 89.10000000000001, 64.35000000000001), kwargs = {} @_wraps(conversion) def normalized(*args, **kwargs): > color = conversion(*args, **kwargs) E TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given /usr/lib/python3.8/site-packages/hsluv.py:33: TypeError ____________________________________________________________________ TestKDEPlotUnivariate.test_legend _____________________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] def test_legend(self, long_df): ax = kdeplot(data=long_df, x="x", hue="a") assert ax.legend_.get_title().get_text() == "a" legend_labels = ax.legend_.get_texts() order = categorical_order(long_df["a"]) for label, level in zip(legend_labels, order): assert label.get_text() == level legend_artists = ax.legend_.findobj(mpl.lines.Line2D)[::2] palette = color_palette() for artist, color in zip(legend_artists, palette): > assert to_rgb(artist.get_color()) == to_rgb(color) E assert (0.3333333333...4313725490196) == (0.8666666666...5686274509804) E At index 0 diff: 0.3333333333333333 != 0.8666666666666667 E Use -v to get more diff seaborn/tests/test_distributions.py:809: AssertionError __________________________________________________________________ TestKDEPlotBivariate.test_fill_artists __________________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] def test_fill_artists(self, long_df): for fill in [True, False]: f, ax = plt.subplots() > kdeplot(data=long_df, x="x", y="y", hue="c", fill=fill) seaborn/tests/test_distributions.py:855: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/_decorators.py:46: in inner_f return f(**kwargs) seaborn/distributions.py:1783: in kdeplot p.plot_bivariate_density( seaborn/distributions.py:1188: in plot_bivariate_density contour_kws["cmap"] = self._cmap_from_color(color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = (0.2980392156862745, 0.4470588235294118, 0.6901960784313725) def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError __________________________________________________________________ TestKDEPlotBivariate.test_common_norm ___________________________________________________________________ self = , rng = RandomState(MT19937) at 0x7F6EB2DA9B40 def test_common_norm(self, rng): hue = np.repeat(["a", "a", "a", "b"], 40) x, y = rng.multivariate_normal([0, 0], [(.2, .5), (.5, 2)], len(hue)).T x[hue == "a"] -= 2 x[hue == "b"] += 2 f, (ax1, ax2) = plt.subplots(ncols=2) kdeplot(x=x, y=y, hue=hue, common_norm=True, ax=ax1) kdeplot(x=x, y=y, hue=hue, common_norm=False, ax=ax2) > n_seg_1 = sum([len(c.get_segments()) > 0 for c in ax1.collections]) seaborn/tests/test_distributions.py:873: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .0 = > n_seg_1 = sum([len(c.get_segments()) > 0 for c in ax1.collections]) E AttributeError: 'PathCollection' object has no attribute 'get_segments' seaborn/tests/test_distributions.py:873: AttributeError ___________________________________________________________________ TestKDEPlotBivariate.test_log_scale ____________________________________________________________________ self = , rng = RandomState(MT19937) at 0x7F6EB2DA9940 def test_log_scale(self, rng): x = rng.lognormal(0, 1, 100) y = rng.uniform(0, 1, 100) levels = .2, .5, 1 f, ax = plt.subplots() kdeplot(x=x, y=y, log_scale=True, levels=levels, ax=ax) assert ax.get_xscale() == "log" assert ax.get_yscale() == "log" f, (ax1, ax2) = plt.subplots(ncols=2) kdeplot(x=x, y=y, log_scale=(10, False), levels=levels, ax=ax1) assert ax1.get_xscale() == "log" assert ax1.get_yscale() == "linear" p = _DistributionPlotter() kde = KDE() density, (xx, yy) = kde(np.log10(x), y) levels = p._quantile_to_level(density, levels) ax2.contour(10 ** xx, yy, density, levels=levels) for c1, c2 in zip(ax1.collections, ax2.collections): > assert_array_equal(c1.get_segments(), c2.get_segments()) E AttributeError: 'PathCollection' object has no attribute 'get_segments' seaborn/tests/test_distributions.py:901: AttributeError ___________________________________________________________________ TestKDEPlotBivariate.test_bandwidth ____________________________________________________________________ self = , rng = RandomState(MT19937) at 0x7F6EB2DA9C40 def test_bandwidth(self, rng): n = 100 x, y = rng.multivariate_normal([0, 0], [(.2, .5), (.5, 2)], n).T f, (ax1, ax2) = plt.subplots(ncols=2) kdeplot(x=x, y=y, ax=ax1) kdeplot(x=x, y=y, bw_adjust=2, ax=ax2) for c1, c2 in zip(ax1.collections, ax2.collections): > seg1, seg2 = c1.get_segments(), c2.get_segments() E AttributeError: 'PathCollection' object has no attribute 'get_segments' seaborn/tests/test_distributions.py:914: AttributeError ____________________________________________________________________ TestKDEPlotBivariate.test_weights _____________________________________________________________________ self = , rng = RandomState(MT19937) at 0x7F6EB2DA9D40 @pytest.mark.skipif( LooseVersion(scipy.__version__) < "1.2.0", reason="Weights require scipy >= 1.2.0" ) def test_weights(self, rng): import warnings warnings.simplefilter("error", np.VisibleDeprecationWarning) n = 100 x, y = rng.multivariate_normal([1, 3], [(.2, .5), (.5, 2)], n).T hue = np.repeat([0, 1], n // 2) weights = rng.uniform(0, 1, n) f, (ax1, ax2) = plt.subplots(ncols=2) kdeplot(x=x, y=y, hue=hue, ax=ax1) kdeplot(x=x, y=y, hue=hue, weights=weights, ax=ax2) for c1, c2 in zip(ax1.collections, ax2.collections): > if c1.get_segments() and c2.get_segments(): E AttributeError: 'PathCollection' object has no attribute 'get_segments' seaborn/tests/test_distributions.py:939: AttributeError ________________________________________________________________ TestKDEPlotBivariate.test_hue_ignores_cmap ________________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] def test_hue_ignores_cmap(self, long_df): with pytest.warns(UserWarning, match="cmap parameter ignored"): ax = kdeplot(data=long_df, x="x", y="y", hue="c", cmap="viridis") > color = tuple(ax.collections[0].get_color().squeeze()) E AttributeError: 'PathCollection' object has no attribute 'get_color' seaborn/tests/test_distributions.py:949: AttributeError ______________________________________________________________ TestKDEPlotBivariate.test_contour_line_colors _______________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] def test_contour_line_colors(self, long_df): color = (.2, .9, .8, 1) ax = kdeplot(data=long_df, x="x", y="y", color=color) for c in ax.collections: > assert tuple(c.get_color().squeeze()) == color E AttributeError: 'PathCollection' object has no attribute 'get_color' seaborn/tests/test_distributions.py:958: AttributeError ______________________________________________________________ TestKDEPlotBivariate.test_contour_fill_colors _______________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] def test_contour_fill_colors(self, long_df): n = 6 color = (.2, .9, .8, 1) > ax = kdeplot( data=long_df, x="x", y="y", fill=True, color=color, levels=n, ) seaborn/tests/test_distributions.py:964: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/_decorators.py:46: in inner_f return f(**kwargs) seaborn/distributions.py:1783: in kdeplot p.plot_bivariate_density( seaborn/distributions.py:1170: in plot_bivariate_density cmap = self._cmap_from_color(default_color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = (0.2, 0.9, 0.8, 1) def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError ____________________________________________________________________ TestKDEPlotBivariate.test_colorbar ____________________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] def test_colorbar(self, long_df): > ax = kdeplot(data=long_df, x="x", y="y", fill=True, cbar=True) seaborn/tests/test_distributions.py:976: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/_decorators.py:46: in inner_f return f(**kwargs) seaborn/distributions.py:1783: in kdeplot p.plot_bivariate_density( seaborn/distributions.py:1170: in plot_bivariate_density cmap = self._cmap_from_color(default_color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = (0.2980392156862745, 0.4470588235294118, 0.6901960784313725) def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError _______________________________________________________________ TestKDEPlotBivariate.test_levels_and_thresh ________________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] def test_levels_and_thresh(self, long_df): f, (ax1, ax2) = plt.subplots(ncols=2) n = 8 thresh = .1 plot_kws = dict(data=long_df, x="x", y="y") kdeplot(**plot_kws, levels=n, thresh=thresh, ax=ax1) kdeplot(**plot_kws, levels=np.linspace(thresh, 1, n), ax=ax2) for c1, c2 in zip(ax1.collections, ax2.collections): > assert_array_equal(c1.get_segments(), c2.get_segments()) E AttributeError: 'PathCollection' object has no attribute 'get_segments' seaborn/tests/test_distributions.py:990: AttributeError _____________________________________________________________________ TestHistPlotBivariate.test_mesh ______________________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] def test_mesh(self, long_df): hist = Histogram() counts, (x_edges, y_edges) = hist(long_df["x"], long_df["y"]) > ax = histplot(long_df, x="x", y="y") seaborn/tests/test_distributions.py:1667: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/distributions.py:1480: in histplot p.plot_bivariate_histogram( seaborn/distributions.py:826: in plot_bivariate_histogram cmap = self._cmap_from_color(color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = 'C0' def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError _________________________________________________________________ TestHistPlotBivariate.test_mesh_with_hue _________________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] def test_mesh_with_hue(self, long_df): > ax = histplot(long_df, x="x", y="y", hue="c") seaborn/tests/test_distributions.py:1682: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/distributions.py:1480: in histplot p.plot_bivariate_histogram( seaborn/distributions.py:819: in plot_bivariate_histogram cmap = self._cmap_from_color(color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = (0.2980392156862745, 0.4470588235294118, 0.6901960784313725) def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError ___________________________________________________________ TestHistPlotBivariate.test_mesh_with_hue_unique_bins ___________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] def test_mesh_with_hue_unique_bins(self, long_df): > ax = histplot(long_df, x="x", y="y", hue="c", common_bins=False) seaborn/tests/test_distributions.py:1705: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/distributions.py:1480: in histplot p.plot_bivariate_histogram( seaborn/distributions.py:819: in plot_bivariate_histogram cmap = self._cmap_from_color(color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = (0.2980392156862745, 0.4470588235294118, 0.6901960784313725) def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError ___________________________________________________________ TestHistPlotBivariate.test_mesh_with_col_unique_bins ___________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] def test_mesh_with_col_unique_bins(self, long_df): > g = displot(long_df, x="x", y="y", col="c", common_bins=False) seaborn/tests/test_distributions.py:1727: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/distributions.py:2279: in displot p.plot_bivariate_histogram(**hist_kws) seaborn/distributions.py:826: in plot_bivariate_histogram cmap = self._cmap_from_color(color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = 'C0' def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError ________________________________________________________________ TestHistPlotBivariate.test_mesh_log_scale _________________________________________________________________ self = , rng = RandomState(MT19937) at 0x7F6EB3455040 def test_mesh_log_scale(self, rng): x, y = rng.lognormal(0, 1, (2, 1000)) hist = Histogram() counts, (x_edges, y_edges) = hist(np.log10(x), np.log10(y)) > ax = histplot(x=x, y=y, log_scale=True) seaborn/tests/test_distributions.py:1753: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/distributions.py:1480: in histplot p.plot_bivariate_histogram( seaborn/distributions.py:826: in plot_bivariate_histogram cmap = self._cmap_from_color(color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = 'C0' def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError __________________________________________________________________ TestHistPlotBivariate.test_mesh_thresh __________________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] def test_mesh_thresh(self, long_df): hist = Histogram() counts, (x_edges, y_edges) = hist(long_df["x"], long_df["y"]) thresh = 5 > ax = histplot(long_df, x="x", y="y", thresh=thresh) seaborn/tests/test_distributions.py:1771: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/distributions.py:1480: in histplot p.plot_bivariate_histogram( seaborn/distributions.py:826: in plot_bivariate_histogram cmap = self._cmap_from_color(color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = 'C0' def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError _______________________________________________________________ TestHistPlotBivariate.test_mesh_sticky_edges _______________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] def test_mesh_sticky_edges(self, long_df): > ax = histplot(long_df, x="x", y="y", thresh=None) seaborn/tests/test_distributions.py:1780: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/distributions.py:1480: in histplot p.plot_bivariate_histogram( seaborn/distributions.py:826: in plot_bivariate_histogram cmap = self._cmap_from_color(color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = 'C0' def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError _______________________________________________________________ TestHistPlotBivariate.test_mesh_common_norm ________________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] def test_mesh_common_norm(self, long_df): stat = "density" > ax = histplot( long_df, x="x", y="y", hue="c", common_norm=True, stat=stat, ) seaborn/tests/test_distributions.py:1794: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/distributions.py:1480: in histplot p.plot_bivariate_histogram( seaborn/distributions.py:819: in plot_bivariate_histogram cmap = self._cmap_from_color(color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = (0.2980392156862745, 0.4470588235294118, 0.6901960784313725) def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError _______________________________________________________________ TestHistPlotBivariate.test_mesh_unique_norm ________________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] def test_mesh_unique_norm(self, long_df): stat = "density" > ax = histplot( long_df, x="x", y="y", hue="c", common_norm=False, stat=stat, ) seaborn/tests/test_distributions.py:1814: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/distributions.py:1480: in histplot p.plot_bivariate_histogram( seaborn/distributions.py:819: in plot_bivariate_histogram cmap = self._cmap_from_color(color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = (0.2980392156862745, 0.4470588235294118, 0.6901960784313725) def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError ________________________________________________________ TestHistPlotBivariate.test_mesh_normalization[probability] ________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] stat = 'probability' @pytest.mark.parametrize("stat", ["probability", "proportion", "percent"]) def test_mesh_normalization(self, long_df, stat): > ax = histplot( long_df, x="x", y="y", stat=stat, ) seaborn/tests/test_distributions.py:1834: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/distributions.py:1480: in histplot p.plot_bivariate_histogram( seaborn/distributions.py:826: in plot_bivariate_histogram cmap = self._cmap_from_color(color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = 'C0' def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError ________________________________________________________ TestHistPlotBivariate.test_mesh_normalization[proportion] _________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] stat = 'proportion' @pytest.mark.parametrize("stat", ["probability", "proportion", "percent"]) def test_mesh_normalization(self, long_df, stat): > ax = histplot( long_df, x="x", y="y", stat=stat, ) seaborn/tests/test_distributions.py:1834: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/distributions.py:1480: in histplot p.plot_bivariate_histogram( seaborn/distributions.py:826: in plot_bivariate_histogram cmap = self._cmap_from_color(color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = 'C0' def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError __________________________________________________________ TestHistPlotBivariate.test_mesh_normalization[percent] __________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] stat = 'percent' @pytest.mark.parametrize("stat", ["probability", "proportion", "percent"]) def test_mesh_normalization(self, long_df, stat): > ax = histplot( long_df, x="x", y="y", stat=stat, ) seaborn/tests/test_distributions.py:1834: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/distributions.py:1480: in histplot p.plot_bivariate_histogram( seaborn/distributions.py:826: in plot_bivariate_histogram cmap = self._cmap_from_color(color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = 'C0' def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError __________________________________________________________________ TestHistPlotBivariate.test_mesh_colors __________________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] def test_mesh_colors(self, long_df): color = "r" f, ax = plt.subplots() > histplot( long_df, x="x", y="y", color=color, ) seaborn/tests/test_distributions.py:1846: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/distributions.py:1480: in histplot p.plot_bivariate_histogram( seaborn/distributions.py:826: in plot_bivariate_histogram cmap = self._cmap_from_color(color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = 'r' def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError _________________________________________________________________ TestHistPlotBivariate.test_color_limits __________________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] def test_color_limits(self, long_df): f, (ax1, ax2, ax3) = plt.subplots(3) kws = dict(data=long_df, x="x", y="y") hist = Histogram() counts, _ = hist(long_df["x"], long_df["y"]) > histplot(**kws, ax=ax1) seaborn/tests/test_distributions.py:1873: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/distributions.py:1480: in histplot p.plot_bivariate_histogram( seaborn/distributions.py:826: in plot_bivariate_histogram cmap = self._cmap_from_color(color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = 'C0' def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError _______________________________________________________________ TestHistPlotBivariate.test_hue_color_limits ________________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] def test_hue_color_limits(self, long_df): _, (ax1, ax2, ax3, ax4) = plt.subplots(4) kws = dict(data=long_df, x="x", y="y", hue="c", bins=4) hist = Histogram(bins=kws["bins"]) hist.define_bin_params(long_df["x"], long_df["y"]) full_counts, _ = hist(long_df["x"], long_df["y"]) sub_counts = [] for _, sub_df in long_df.groupby(kws["hue"]): c, _ = hist(sub_df["x"], sub_df["y"]) sub_counts.append(c) pmax = .8 pthresh = .05 f = _DistributionPlotter()._quantile_to_level > histplot(**kws, common_norm=True, ax=ax1) seaborn/tests/test_distributions.py:1912: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/distributions.py:1480: in histplot p.plot_bivariate_histogram( seaborn/distributions.py:819: in plot_bivariate_histogram cmap = self._cmap_from_color(color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = (0.2980392156862745, 0.4470588235294118, 0.6901960784313725) def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError ___________________________________________________________________ TestHistPlotBivariate.test_colorbar ____________________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] def test_colorbar(self, long_df): f, ax = plt.subplots() > histplot(long_df, x="x", y="y", cbar=True, ax=ax) seaborn/tests/test_distributions.py:1939: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/distributions.py:1480: in histplot p.plot_bivariate_histogram( seaborn/distributions.py:826: in plot_bivariate_histogram cmap = self._cmap_from_color(color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = 'C0' def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError ____________________________________________________________ TestDisPlot.test_versus_single_histplot[kwargs15] _____________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] kwargs = {'x': 'x', 'y': 'y'} @pytest.mark.parametrize( "kwargs", [ dict(), dict(x="x"), dict(x="t"), dict(x="a"), dict(x="z", log_scale=True), dict(x="x", binwidth=4), dict(x="x", weights="f", bins=5), dict(x="x", color="green", linewidth=2, binwidth=4), dict(x="x", hue="a", fill=False), dict(x="y", hue="a", fill=False), dict(x="x", hue="a", multiple="stack"), dict(x="x", hue="a", element="step"), dict(x="x", hue="a", palette="muted"), dict(x="x", hue="a", kde=True), dict(x="x", hue="a", stat="density", common_norm=False), dict(x="x", y="y"), ], ) def test_versus_single_histplot(self, long_df, kwargs): > ax = histplot(long_df, **kwargs) seaborn/tests/test_distributions.py:2082: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/distributions.py:1480: in histplot p.plot_bivariate_histogram( seaborn/distributions.py:826: in plot_bivariate_histogram cmap = self._cmap_from_color(color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = 'C0' def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError ____________________________________________________________________ TestDisPlot.test_with_rug[kwargs0] ____________________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] kwargs = {'x': 'x'} @pytest.mark.parametrize( "kwargs", [ dict(x="x"), dict(x="x", y="y"), dict(x="x", hue="a"), ] ) def test_with_rug(self, long_df, kwargs): ax = rugplot(data=long_df, **kwargs) g = displot(long_df, rug=True, **kwargs) > g.ax.patches = [] E AttributeError: can't set attribute seaborn/tests/test_distributions.py:2166: AttributeError ____________________________________________________________________ TestDisPlot.test_with_rug[kwargs1] ____________________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] kwargs = {'x': 'x', 'y': 'y'} @pytest.mark.parametrize( "kwargs", [ dict(x="x"), dict(x="x", y="y"), dict(x="x", hue="a"), ] ) def test_with_rug(self, long_df, kwargs): ax = rugplot(data=long_df, **kwargs) > g = displot(long_df, rug=True, **kwargs) seaborn/tests/test_distributions.py:2165: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/distributions.py:2279: in displot p.plot_bivariate_histogram(**hist_kws) seaborn/distributions.py:826: in plot_bivariate_histogram cmap = self._cmap_from_color(color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = 'C0' def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError ____________________________________________________________________ TestDisPlot.test_with_rug[kwargs2] ____________________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] kwargs = {'hue': 'a', 'x': 'x'} @pytest.mark.parametrize( "kwargs", [ dict(x="x"), dict(x="x", y="y"), dict(x="x", hue="a"), ] ) def test_with_rug(self, long_df, kwargs): ax = rugplot(data=long_df, **kwargs) g = displot(long_df, rug=True, **kwargs) > g.ax.patches = [] E AttributeError: can't set attribute seaborn/tests/test_distributions.py:2166: AttributeError ___________________________________________________________________ TestDisPlot.test_bivariate_kde_norm ____________________________________________________________________ self = , rng = RandomState(MT19937) at 0x7F6EB2D8FE40 def test_bivariate_kde_norm(self, rng): x, y = rng.normal(0, 1, (2, 100)) z = [0] * 80 + [1] * 20 g = displot(x=x, y=y, col=z, kind="kde", levels=10) > l1 = sum(bool(c.get_segments()) for c in g.axes.flat[0].collections) seaborn/tests/test_distributions.py:2249: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .0 = > l1 = sum(bool(c.get_segments()) for c in g.axes.flat[0].collections) E AttributeError: 'PathCollection' object has no attribute 'get_segments' seaborn/tests/test_distributions.py:2249: AttributeError ___________________________________________________________________ TestDisPlot.test_bivariate_hist_norm ___________________________________________________________________ self = , rng = RandomState(MT19937) at 0x7F6EB2D8FD40 def test_bivariate_hist_norm(self, rng): x, y = rng.normal(0, 1, (2, 100)) z = [0] * 80 + [1] * 20 > g = displot(x=x, y=y, col=z, kind="hist") seaborn/tests/test_distributions.py:2263: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/distributions.py:2279: in displot p.plot_bivariate_histogram(**hist_kws) seaborn/distributions.py:826: in plot_bivariate_histogram cmap = self._cmap_from_color(color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , color = 'C0' def _cmap_from_color(self, color): """Return a sequential colormap given a color seed.""" # Like so much else here, this is broadly useful, but keeping it # in this class to signify that I haven't thought overly hard about it... r, g, b, _ = to_rgba(color) > h, s, _ = hsluv.rgb_to_hsluv(r, g, b) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/distributions.py:195: TypeError ______________________________________________________________________ TestPalPlot.test_palplot_size _______________________________________________________________________ self = def test_palplot_size(self): > pal4 = color_palette("hsluv", 4) seaborn/tests/test_miscplot.py:12: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/palettes.py:170: in color_palette palette = hsluv_palette(n_colors, as_cmap=as_cmap) seaborn/palettes.py:367: in hsluv_palette palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:367: in palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:462: in _color_to_rgb color = hsluv.hsluv_to_rgb(*color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (3.59, 89.10000000000001, 64.35000000000001), kwargs = {} @_wraps(conversion) def normalized(*args, **kwargs): > color = conversion(*args, **kwargs) E TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given /usr/lib/python3.8/site-packages/hsluv.py:33: TypeError ________________________________________________________________ TestColorPalettes.test_big_palette_context ________________________________________________________________ self = def test_big_palette_context(self): original_pal = palettes.color_palette("deep", n_colors=8) > context_pal = palettes.color_palette("hsluv", 10) seaborn/tests/test_palettes.py:35: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/palettes.py:170: in color_palette palette = hsluv_palette(n_colors, as_cmap=as_cmap) seaborn/palettes.py:367: in hsluv_palette palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:367: in palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:462: in _color_to_rgb color = hsluv.hsluv_to_rgb(*color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (3.59, 89.10000000000001, 64.35000000000001), kwargs = {} @_wraps(conversion) def normalized(*args, **kwargs): > color = conversion(*args, **kwargs) E TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given /usr/lib/python3.8/site-packages/hsluv.py:33: TypeError ___________________________________________________________________ TestColorPalettes.test_palette_size ____________________________________________________________________ self = def test_palette_size(self): pal = palettes.color_palette("deep") assert len(pal) == palettes.QUAL_PALETTE_SIZES["deep"] pal = palettes.color_palette("pastel6") assert len(pal) == palettes.QUAL_PALETTE_SIZES["pastel6"] pal = palettes.color_palette("Set3") assert len(pal) == palettes.QUAL_PALETTE_SIZES["Set3"] > pal = palettes.color_palette("hsluv") seaborn/tests/test_palettes.py:57: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/palettes.py:170: in color_palette palette = hsluv_palette(n_colors, as_cmap=as_cmap) seaborn/palettes.py:367: in hsluv_palette palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:367: in palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:462: in _color_to_rgb color = hsluv.hsluv_to_rgb(*color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (3.59, 89.10000000000001, 64.35000000000001), kwargs = {} @_wraps(conversion) def normalized(*args, **kwargs): > color = conversion(*args, **kwargs) E TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given /usr/lib/python3.8/site-packages/hsluv.py:33: TypeError ___________________________________________________________________ TestColorPalettes.test_hsluv_palette ___________________________________________________________________ self = def test_hsluv_palette(self): > pal1 = palettes.hsluv_palette() seaborn/tests/test_palettes.py:84: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/palettes.py:367: in hsluv_palette palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:367: in palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:462: in _color_to_rgb color = hsluv.hsluv_to_rgb(*color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (3.59, 89.10000000000001, 64.35000000000001), kwargs = {} @_wraps(conversion) def normalized(*args, **kwargs): > color = conversion(*args, **kwargs) E TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given /usr/lib/python3.8/site-packages/hsluv.py:33: TypeError ___________________________________________________________________ TestColorPalettes.test_palette_desat ___________________________________________________________________ self = def test_palette_desat(self): > pal1 = palettes.hsluv_palette(6) seaborn/tests/test_palettes.py:132: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/palettes.py:367: in hsluv_palette palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:367: in palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:462: in _color_to_rgb color = hsluv.hsluv_to_rgb(*color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (3.59, 89.10000000000001, 64.35000000000001), kwargs = {} @_wraps(conversion) def normalized(*args, **kwargs): > color = conversion(*args, **kwargs) E TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given /usr/lib/python3.8/site-packages/hsluv.py:33: TypeError ___________________________________________________________________ TestColorPalettes.test_hsluv_values ____________________________________________________________________ self = def test_hsluv_values(self): > pal1 = palettes.hsluv_palette(6, h=0) seaborn/tests/test_palettes.py:172: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/palettes.py:367: in hsluv_palette palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:367: in palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:462: in _color_to_rgb color = hsluv.hsluv_to_rgb(*color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (0.0, 89.10000000000001, 64.35000000000001), kwargs = {} @_wraps(conversion) def normalized(*args, **kwargs): > color = conversion(*args, **kwargs) E TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given /usr/lib/python3.8/site-packages/hsluv.py:33: TypeError __________________________________________________________________ TestColorPalettes.test_rgb_from_hsluv ___________________________________________________________________ self = def test_rgb_from_hsluv(self): color = 120, 50, 40 > rgb_got = palettes._color_to_rgb(color, "hsluv") seaborn/tests/test_palettes.py:213: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/palettes.py:462: in _color_to_rgb color = hsluv.hsluv_to_rgb(*color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (120, 50, 40), kwargs = {} @_wraps(conversion) def normalized(*args, **kwargs): > color = conversion(*args, **kwargs) E TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given /usr/lib/python3.8/site-packages/hsluv.py:33: TypeError ___________________________________________________________________ TestColorPalettes.test_light_palette ___________________________________________________________________ self = def test_light_palette(self): n = 4 > pal_forward = palettes.light_palette("red", n) seaborn/tests/test_palettes.py:233: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ color = 'red', n_colors = 4, reverse = False, as_cmap = False, input = 'rgb' def light_palette(color, n_colors=6, reverse=False, as_cmap=False, input="rgb"): """Make a sequential palette that blends from light to ``color``. This kind of palette is good for data that range between relatively uninteresting low values and interesting high values. The ``color`` parameter can be specified in a number of ways, including all options for defining a color in matplotlib and several additional color spaces that are handled by seaborn. You can also use the database of named colors from the XKCD color survey. If you are using the IPython notebook, you can also choose this palette interactively with the :func:`choose_light_palette` function. Parameters ---------- color : base color for high values hex code, html color name, or tuple in ``input`` space. n_colors : int, optional number of colors in the palette reverse : bool, optional if True, reverse the direction of the blend as_cmap : bool, optional If True, return a :class:`matplotlib.colors.Colormap`. input : {'rgb', 'hls', 'hsluv', xkcd'} Color space to interpret the input color. The first three options apply to tuple inputs and the latter applies to string inputs. Returns ------- list of RGB tuples or :class:`matplotlib.colors.Colormap` See Also -------- dark_palette : Create a sequential palette with dark low values. diverging_palette : Create a diverging palette with two colors. Examples -------- Generate a palette from an HTML color: .. plot:: :context: close-figs >>> import seaborn as sns; sns.set_theme() >>> sns.palplot(sns.light_palette("purple")) Generate a palette that increases in lightness: .. plot:: :context: close-figs >>> sns.palplot(sns.light_palette("seagreen", reverse=True)) Generate a palette from an HUSL-space seed: .. plot:: :context: close-figs >>> sns.palplot(sns.light_palette((260, 75, 60), input="hsluv")) Generate a colormap object: .. plot:: :context: close-figs >>> from numpy import arange >>> x = arange(25).reshape(5, 5) >>> cmap = sns.light_palette("#2ecc71", as_cmap=True) >>> ax = sns.heatmap(x, cmap=cmap) """ rgb = _color_to_rgb(color, input) > h, s, l = hsluv.rgb_to_hsluv(*rgb) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/palettes.py:625: TypeError ___________________________________________________________________ TestColorPalettes.test_dark_palette ____________________________________________________________________ self = def test_dark_palette(self): n = 4 > pal_forward = palettes.dark_palette("red", n) seaborn/tests/test_palettes.py:259: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ color = 'red', n_colors = 4, reverse = False, as_cmap = False, input = 'rgb' def dark_palette(color, n_colors=6, reverse=False, as_cmap=False, input="rgb"): """Make a sequential palette that blends from dark to ``color``. This kind of palette is good for data that range between relatively uninteresting low values and interesting high values. The ``color`` parameter can be specified in a number of ways, including all options for defining a color in matplotlib and several additional color spaces that are handled by seaborn. You can also use the database of named colors from the XKCD color survey. If you are using the IPython notebook, you can also choose this palette interactively with the :func:`choose_dark_palette` function. Parameters ---------- color : base color for high values hex, rgb-tuple, or html color name n_colors : int, optional number of colors in the palette reverse : bool, optional if True, reverse the direction of the blend as_cmap : bool, optional If True, return a :class:`matplotlib.colors.Colormap`. input : {'rgb', 'hls', 'hsluv', xkcd'} Color space to interpret the input color. The first three options apply to tuple inputs and the latter applies to string inputs. Returns ------- list of RGB tuples or :class:`matplotlib.colors.Colormap` See Also -------- light_palette : Create a sequential palette with bright low values. diverging_palette : Create a diverging palette with two colors. Examples -------- Generate a palette from an HTML color: .. plot:: :context: close-figs >>> import seaborn as sns; sns.set_theme() >>> sns.palplot(sns.dark_palette("purple")) Generate a palette that decreases in lightness: .. plot:: :context: close-figs >>> sns.palplot(sns.dark_palette("seagreen", reverse=True)) Generate a palette from an HUSL-space seed: .. plot:: :context: close-figs >>> sns.palplot(sns.dark_palette((260, 75, 60), input="hsluv")) Generate a colormap object: .. plot:: :context: close-figs >>> from numpy import arange >>> x = arange(25).reshape(5, 5) >>> cmap = sns.dark_palette("#2ecc71", as_cmap=True) >>> ax = sns.heatmap(x, cmap=cmap) """ rgb = _color_to_rgb(color, input) > h, s, l = hsluv.rgb_to_hsluv(*rgb) E TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given seaborn/palettes.py:544: TypeError _________________________________________________________________ TestColorPalettes.test_diverging_palette _________________________________________________________________ self = def test_diverging_palette(self): h_neg, h_pos = 100, 200 sat, lum = 70, 50 args = h_neg, h_pos, sat, lum n = 12 > pal = palettes.diverging_palette(*args, n=n) seaborn/tests/test_palettes.py:289: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/palettes.py:704: in diverging_palette neg = palfunc((h_neg, s, l), n_half, reverse=True, input="hsluv") seaborn/palettes.py:624: in light_palette rgb = _color_to_rgb(color, input) seaborn/palettes.py:462: in _color_to_rgb color = hsluv.hsluv_to_rgb(*color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (100, 70, 50), kwargs = {} @_wraps(conversion) def normalized(*args, **kwargs): > color = conversion(*args, **kwargs) E TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given /usr/lib/python3.8/site-packages/hsluv.py:33: TypeError ___________________________________________________________ TestRelationalPlotter.test_relplot_stringy_numerics ____________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str x_str 0 12 0.449243 6.611886 b p 0 200... 8 8 14 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 15 [100 rows x 13 columns] def test_relplot_stringy_numerics(self, long_df): long_df["x_str"] = long_df["x"].astype(str) > g = relplot(data=long_df, x="x", y="y", hue="x_str") seaborn/tests/test_relational.py:667: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/_decorators.py:46: in inner_f return f(**kwargs) seaborn/relational.py:947: in relplot p = plotter( seaborn/relational.py:587: in __init__ super().__init__(data=data, variables=variables) seaborn/_core.py:614: in __init__ getattr(self, f"map_{var}")() seaborn/_core.py:53: in map setattr(plotter, method_name, cls(plotter, *args, **kwargs)) seaborn/_core.py:118: in __init__ levels, lookup_table = self.categorical_mapping( seaborn/_core.py:200: in categorical_mapping colors = color_palette("hsluv", n_colors) seaborn/palettes.py:170: in color_palette palette = hsluv_palette(n_colors, as_cmap=as_cmap) seaborn/palettes.py:367: in hsluv_palette palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:367: in palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:462: in _color_to_rgb color = hsluv.hsluv_to_rgb(*color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (3.59, 89.10000000000001, 64.35000000000001), kwargs = {} @_wraps(conversion) def normalized(*args, **kwargs): > color = conversion(*args, **kwargs) E TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given /usr/lib/python3.8/site-packages/hsluv.py:33: TypeError ________________________________________________________________________ TestLinePlotter.test_plot _________________________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] repeated_df = x y a u 0 0 0.050892 a 0 1 1 -1.271706 b 0 2 2 0.474163 b 0 3 3 0.640278 a 0 4 ... 1 96 46 -1.169076 a 1 97 47 0.570761 b 1 98 48 -0.332464 c 1 99 49 0.167057 a 1 [100 rows x 4 columns] def test_plot(self, long_df, repeated_df): f, ax = plt.subplots() p = _LinePlotter( data=long_df, variables=dict(x="x", y="y"), sort=False, estimator=None ) p.plot(ax, {}) line, = ax.lines assert_array_equal(line.get_xdata(), long_df.x.values) assert_array_equal(line.get_ydata(), long_df.y.values) ax.clear() p.plot(ax, {"color": "k", "label": "test"}) line, = ax.lines assert line.get_color() == "k" assert line.get_label() == "test" p = _LinePlotter( data=long_df, variables=dict(x="x", y="y"), sort=True, estimator=None ) ax.clear() p.plot(ax, {}) line, = ax.lines sorted_data = long_df.sort_values(["x", "y"]) assert_array_equal(line.get_xdata(), sorted_data.x.values) assert_array_equal(line.get_ydata(), sorted_data.y.values) p = _LinePlotter( data=long_df, variables=dict(x="x", y="y", hue="a"), ) ax.clear() p.plot(ax, {}) assert len(ax.lines) == len(p._hue_map.levels) for line, level in zip(ax.lines, p._hue_map.levels): assert line.get_color() == p._hue_map(level) p = _LinePlotter( data=long_df, variables=dict(x="x", y="y", size="a"), ) ax.clear() p.plot(ax, {}) assert len(ax.lines) == len(p._size_map.levels) for line, level in zip(ax.lines, p._size_map.levels): assert line.get_linewidth() == p._size_map(level) p = _LinePlotter( data=long_df, variables=dict(x="x", y="y", hue="a", style="a"), ) p.map_style(markers=True) ax.clear() p.plot(ax, {}) assert len(ax.lines) == len(p._hue_map.levels) assert len(ax.lines) == len(p._style_map.levels) for line, level in zip(ax.lines, p._hue_map.levels): assert line.get_color() == p._hue_map(level) assert line.get_marker() == p._style_map(level, "marker") p = _LinePlotter( data=long_df, variables=dict(x="x", y="y", hue="a", style="b"), ) p.map_style(markers=True) ax.clear() p.plot(ax, {}) levels = product(p._hue_map.levels, p._style_map.levels) expected_line_count = len(p._hue_map.levels) * len(p._style_map.levels) assert len(ax.lines) == expected_line_count for line, (hue, style) in zip(ax.lines, levels): assert line.get_color() == p._hue_map(hue) assert line.get_marker() == p._style_map(style, "marker") p = _LinePlotter( data=long_df, variables=dict(x="x", y="y"), estimator="mean", err_style="band", ci="sd", sort=True ) ax.clear() p.plot(ax, {}) line, = ax.lines expected_data = long_df.groupby("x").y.mean() assert_array_equal(line.get_xdata(), expected_data.index.values) assert np.allclose(line.get_ydata(), expected_data.values) assert len(ax.collections) == 1 # Test that nans do not propagate to means or CIs p = _LinePlotter( variables=dict( x=[1, 1, 1, 2, 2, 2, 3, 3, 3], y=[1, 2, 3, 3, np.nan, 5, 4, 5, 6], ), estimator="mean", err_style="band", ci=95, n_boot=100, sort=True, ) ax.clear() p.plot(ax, {}) line, = ax.lines assert line.get_xdata().tolist() == [1, 2, 3] err_band = ax.collections[0].get_paths() assert len(err_band) == 1 assert len(err_band[0].vertices) == 9 p = _LinePlotter( data=long_df, variables=dict(x="x", y="y", hue="a"), estimator="mean", err_style="band", ci="sd" ) ax.clear() p.plot(ax, {}) assert len(ax.lines) == len(ax.collections) == len(p._hue_map.levels) for c in ax.collections: assert isinstance(c, mpl.collections.PolyCollection) p = _LinePlotter( data=long_df, variables=dict(x="x", y="y", hue="a"), estimator="mean", err_style="bars", ci="sd" ) ax.clear() p.plot(ax, {}) n_lines = len(ax.lines) assert n_lines / 2 == len(ax.collections) == len(p._hue_map.levels) assert len(ax.collections) == len(p._hue_map.levels) for c in ax.collections: assert isinstance(c, mpl.collections.LineCollection) p = _LinePlotter( data=repeated_df, variables=dict(x="x", y="y", units="u"), estimator=None ) ax.clear() p.plot(ax, {}) n_units = len(repeated_df["u"].unique()) assert len(ax.lines) == n_units p = _LinePlotter( data=repeated_df, variables=dict(x="x", y="y", hue="a", units="u"), estimator=None ) ax.clear() p.plot(ax, {}) n_units *= len(repeated_df["a"].unique()) assert len(ax.lines) == n_units p.estimator = "mean" with pytest.raises(ValueError): p.plot(ax, {}) p = _LinePlotter( data=long_df, variables=dict(x="x", y="y", hue="a"), err_style="band", err_kws={"alpha": .5}, ) ax.clear() p.plot(ax, {}) for band in ax.collections: assert band.get_alpha() == .5 p = _LinePlotter( data=long_df, variables=dict(x="x", y="y", hue="a"), err_style="bars", err_kws={"elinewidth": 2}, ) ax.clear() p.plot(ax, {}) for lines in ax.collections: assert lines.get_linestyles() == 2 p.err_style = "invalid" with pytest.raises(ValueError): p.plot(ax, {}) x_str = long_df["x"].astype(str) > p = _LinePlotter( data=long_df, variables=dict(x="x", y="y", hue=x_str), ) seaborn/tests/test_relational.py:1215: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/relational.py:367: in __init__ super().__init__(data=data, variables=variables) seaborn/_core.py:614: in __init__ getattr(self, f"map_{var}")() seaborn/_core.py:53: in map setattr(plotter, method_name, cls(plotter, *args, **kwargs)) seaborn/_core.py:118: in __init__ levels, lookup_table = self.categorical_mapping( seaborn/_core.py:200: in categorical_mapping colors = color_palette("hsluv", n_colors) seaborn/palettes.py:170: in color_palette palette = hsluv_palette(n_colors, as_cmap=as_cmap) seaborn/palettes.py:367: in hsluv_palette palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:367: in palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:462: in _color_to_rgb color = hsluv.hsluv_to_rgb(*color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (3.59, 89.10000000000001, 64.35000000000001), kwargs = {} @_wraps(conversion) def normalized(*args, **kwargs): > color = conversion(*args, **kwargs) E TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given /usr/lib/python3.8/site-packages/hsluv.py:33: TypeError _______________________________________________________________________ TestScatterPlotter.test_plot _______________________________________________________________________ self = long_df = x y z a b c t s f a_cat s_cat s_str 0 12 0.449243 6.611886 b p 0 2004-01-0...0.3 a 8 8 99 15 0.073484 1.036343 c p 0 2005-01-01 2 0.3 c 2 2 [100 rows x 12 columns] repeated_df = x y a u 0 0 0.050892 a 0 1 1 -1.271706 b 0 2 2 0.474163 b 0 3 3 0.640278 a 0 4 ... 1 96 46 -1.169076 a 1 97 47 0.570761 b 1 98 48 -0.332464 c 1 99 49 0.167057 a 1 [100 rows x 4 columns] def test_plot(self, long_df, repeated_df): f, ax = plt.subplots() p = _ScatterPlotter(data=long_df, variables=dict(x="x", y="y")) p.plot(ax, {}) points = ax.collections[0] assert_array_equal(points.get_offsets(), long_df[["x", "y"]].values) ax.clear() p.plot(ax, {"color": "k", "label": "test"}) points = ax.collections[0] assert same_color(points.get_facecolor(), "k") assert points.get_label() == "test" p = _ScatterPlotter( data=long_df, variables=dict(x="x", y="y", hue="a") ) ax.clear() p.plot(ax, {}) points = ax.collections[0] expected_colors = p._hue_map(p.plot_data["hue"]) assert same_color(points.get_facecolors(), expected_colors) p = _ScatterPlotter( data=long_df, variables=dict(x="x", y="y", style="c"), ) p.map_style(markers=["+", "x"]) ax.clear() color = (1, .3, .8) p.plot(ax, {"color": color}) points = ax.collections[0] assert same_color(points.get_edgecolors(), [color]) p = _ScatterPlotter( data=long_df, variables=dict(x="x", y="y", size="a"), ) ax.clear() p.plot(ax, {}) points = ax.collections[0] expected_sizes = p._size_map(p.plot_data["size"]) assert_array_equal(points.get_sizes(), expected_sizes) p = _ScatterPlotter( data=long_df, variables=dict(x="x", y="y", hue="a", style="a"), ) p.map_style(markers=True) ax.clear() p.plot(ax, {}) points = ax.collections[0] expected_colors = p._hue_map(p.plot_data["hue"]) expected_paths = p._style_map(p.plot_data["style"], "path") assert same_color(points.get_facecolors(), expected_colors) assert self.paths_equal(points.get_paths(), expected_paths) p = _ScatterPlotter( data=long_df, variables=dict(x="x", y="y", hue="a", style="b"), ) p.map_style(markers=True) ax.clear() p.plot(ax, {}) points = ax.collections[0] expected_colors = p._hue_map(p.plot_data["hue"]) expected_paths = p._style_map(p.plot_data["style"], "path") assert same_color(points.get_facecolors(), expected_colors) assert self.paths_equal(points.get_paths(), expected_paths) x_str = long_df["x"].astype(str) > p = _ScatterPlotter( data=long_df, variables=dict(x="x", y="y", hue=x_str), ) seaborn/tests/test_relational.py:1632: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seaborn/relational.py:587: in __init__ super().__init__(data=data, variables=variables) seaborn/_core.py:614: in __init__ getattr(self, f"map_{var}")() seaborn/_core.py:53: in map setattr(plotter, method_name, cls(plotter, *args, **kwargs)) seaborn/_core.py:118: in __init__ levels, lookup_table = self.categorical_mapping( seaborn/_core.py:200: in categorical_mapping colors = color_palette("hsluv", n_colors) seaborn/palettes.py:170: in color_palette palette = hsluv_palette(n_colors, as_cmap=as_cmap) seaborn/palettes.py:367: in hsluv_palette palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:367: in palette = [_color_to_rgb((h_i, s, l), input="hsluv") for h_i in hues] seaborn/palettes.py:462: in _color_to_rgb color = hsluv.hsluv_to_rgb(*color) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (3.59, 89.10000000000001, 64.35000000000001), kwargs = {} @_wraps(conversion) def normalized(*args, **kwargs): > color = conversion(*args, **kwargs) E TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given /usr/lib/python3.8/site-packages/hsluv.py:33: TypeError ============================================================================= warnings summary ============================================================================= seaborn/rcmod.py:82 /home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2/seaborn/rcmod.py:82: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. if LooseVersion(mpl.__version__) >= "3.0": ../../../../../usr/lib/python3.8/site-packages/setuptools/_distutils/version.py:346: 10 warnings seaborn/tests/test_axisgrid.py: 2 warnings seaborn/tests/test_categorical.py: 72 warnings seaborn/tests/test_core.py: 2 warnings seaborn/tests/test_distributions.py: 9 warnings seaborn/tests/test_palettes.py: 1 warning seaborn/tests/test_rcmod.py: 34 warnings seaborn/tests/test_utils.py: 3 warnings /usr/lib/python3.8/site-packages/setuptools/_distutils/version.py:346: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. other = LooseVersion(other) seaborn/tests/test_algorithms.py:154 /home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2/seaborn/tests/test_algorithms.py:154: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. @pytest.mark.skipif(LooseVersion(np.__version__) < "1.17", seaborn/tests/test_algorithms.py:180 /home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2/seaborn/tests/test_algorithms.py:180: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. @pytest.mark.skipif(LooseVersion(np.__version__) >= "1.17", seaborn/tests/test_algorithms.py:197 /home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2/seaborn/tests/test_algorithms.py:197: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. @pytest.mark.skipif(LooseVersion(np.__version__) >= "1.17", seaborn/tests/test_categorical.py:3015 /home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2/seaborn/tests/test_categorical.py:3015: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. LooseVersion(pd.__version__) < "1.2", seaborn/tests/test_distributions.py:535 /home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2/seaborn/tests/test_distributions.py:535: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. LooseVersion(np.__version__) < "1.17", seaborn/tests/test_distributions.py:739 /home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2/seaborn/tests/test_distributions.py:739: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. LooseVersion(scipy.__version__) < "1.2.0", seaborn/tests/test_distributions.py:921 /home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2/seaborn/tests/test_distributions.py:921: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. LooseVersion(scipy.__version__) < "1.2.0", seaborn/tests/test_distributions.py:1335 /home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2/seaborn/tests/test_distributions.py:1335: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. LooseVersion(np.__version__) < "1.17", seaborn/tests/test_regression.py:600 /home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2/seaborn/tests/test_regression.py:600: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. @pytest.mark.skipif(LooseVersion(mpl.__version__) < "3.4", seaborn/tests/test_axisgrid.py: 30 warnings seaborn/tests/test_categorical.py: 6 warnings seaborn/tests/test_distributions.py: 74 warnings seaborn/tests/test_regression.py: 16 warnings seaborn/tests/test_relational.py: 80 warnings seaborn/tests/test_utils.py: 2 warnings /home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2/seaborn/axisgrid.py:130: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. if LooseVersion(mpl.__version__) < LooseVersion("3.0"): seaborn/tests/test_axisgrid.py: 2 warnings seaborn/tests/test_palettes.py: 1 warning seaborn/tests/test_rcmod.py: 33 warnings seaborn/tests/test_utils.py: 1 warning /home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2/seaborn/rcmod.py:400: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. if LooseVersion(mpl.__version__) >= "3.0": seaborn/tests/test_categorical.py: 72 warnings /home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2/seaborn/categorical.py:381: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. if LooseVersion(mpl.__version__) < "3.0": seaborn/tests/test_categorical.py::TestCatPlot::test_share_xy seaborn/tests/test_categorical.py::TestCatPlot::test_share_xy seaborn/tests/test_distributions.py::TestKDEPlotUnivariate::test_singular_data seaborn/tests/test_distributions.py::TestKDEPlotBivariate::test_singular_data seaborn/tests/test_distributions.py::TestHistPlotUnivariate::test_kde_singular_data seaborn/tests/test_distributions.py::TestHistPlotUnivariate::test_kde_singular_data seaborn/tests/test_relational.py::TestScatterPlotter::test_unfilled_marker_edgecolor_warning /usr/lib/python3.8/site-packages/_pytest/python.py:198: PytestRemovedIn8Warning: Passing None has been deprecated. See https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests for alternatives in common use cases. result = testfunction(**testargs) seaborn/tests/test_categorical.py: 10 warnings /home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2/seaborn/tests/test_categorical.py:2999: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. if LooseVersion(mpl.__version__) >= LooseVersion("3.0"): seaborn/tests/test_core.py: 4 warnings seaborn/tests/test_distributions.py: 43 warnings seaborn/tests/test_relational.py: 5 warnings /home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2/seaborn/conftest.py:83: FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead. index = pd.Int64Index(np.arange(10, 30), name="t") seaborn/tests/test_core.py: 3 warnings seaborn/tests/test_distributions.py: 4 warnings seaborn/tests/test_relational.py: 7 warnings /home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2/seaborn/conftest.py:67: FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead. index = pd.Int64Index(np.arange(10, 50, 2), name="wide_index") seaborn/tests/test_core.py::TestVectorPlotter::test_flat_variables[series] seaborn/tests/test_core.py::TestVectorPlotter::test_flat_variables[array] seaborn/tests/test_core.py::TestVectorPlotter::test_flat_variables[list] /home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2/seaborn/conftest.py:106: FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead. index = pd.Int64Index(np.arange(10, 30), name="t") seaborn/tests/test_core.py::TestVectorPlotter::test_attach_log_scale seaborn/tests/test_core.py::TestVectorPlotter::test_attach_log_scale seaborn/tests/test_distributions.py::TestKDEPlotUnivariate::test_log_scale_explicit seaborn/tests/test_distributions.py::TestKDEPlotBivariate::test_log_scale /home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2/seaborn/_core.py:1165: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. if LooseVersion(mpl.__version__) >= "3.3": seaborn/tests/test_distributions.py::TestKDEPlotUnivariate::test_weights seaborn/tests/test_distributions.py::TestKDEPlotBivariate::test_weights seaborn/tests/test_distributions.py::TestKDEPlotBivariate::test_weights seaborn/tests/test_distributions.py::TestDisPlot::test_versus_single_kdeplot[kwargs5] seaborn/tests/test_distributions.py::TestDisPlot::test_versus_single_kdeplot[kwargs5] seaborn/tests/test_distributions.py::TestDisPlot::test_versus_single_kdeplot[kwargs5] /home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2/seaborn/_statistics.py:132: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. if LooseVersion(sp.__version__) < "1.2.0": seaborn/tests/test_distributions.py::TestDisPlot::test_versus_single_kdeplot[kwargs5] /home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2/seaborn/tests/test_distributions.py:2112: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. if "weights" in kwargs and LooseVersion(scipy.__version__) < "1.2": seaborn/tests/test_rcmod.py::TestPlottingContext::test_font_scale /home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2/seaborn/tests/test_rcmod.py:187: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. if LooseVersion(mpl.__version__) >= "3.0": seaborn/tests/test_utils.py::test_locator_to_legend_entries /home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2/seaborn/tests/test_utils.py:376: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. if LooseVersion(mpl.__version__) >= "3.1": seaborn/tests/test_utils.py::test_locator_to_legend_entries /home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2/seaborn/tests/test_utils.py:383: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. if LooseVersion(mpl.__version__) >= "3.1": -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [5] seaborn/tests/test_algorithms.py:180: Tests old numpy random functionality SKIPPED [1] seaborn/tests/test_algorithms.py:197: Tests old numpy random functionality SKIPPED [3] seaborn/tests/test_core.py:1100: No pandas.NA available SKIPPED [1] seaborn/tests/test_matrix.py:624: fastcluster not installed SKIPPED [1] seaborn/tests/test_matrix.py:635: fastcluster not installed SKIPPED [1] seaborn/tests/test_rcmod.py:247: Verdana font is not present SKIPPED [1] seaborn/tests/test_rcmod.py:270: Verdana font is not present SKIPPED [1] seaborn/tests/test_regression.py:188: no statsmodels SKIPPED [1] seaborn/tests/test_regression.py:202: no statsmodels SKIPPED [1] seaborn/tests/test_regression.py:230: no statsmodels SKIPPED [1] seaborn/tests/test_regression.py:247: no statsmodels SKIPPED [1] seaborn/tests/test_regression.py:388: no statsmodels SKIPPED [1] seaborn/tests/test_regression.py:397: no statsmodels SKIPPED [1] seaborn/tests/test_regression.py:407: no statsmodels SKIPPED [1] seaborn/tests/test_regression.py:420: no statsmodels SKIPPED [1] seaborn/tests/test_regression.py:649: no statsmodels SKIPPED [1] seaborn/tests/test_statistics.py:436: Requires statsmodels FAILED seaborn/tests/test_axisgrid.py::TestFacetGrid::test_palette - TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_axisgrid.py::TestPairGrid::test_remove_hue_from_default - TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_axisgrid.py::TestPairGrid::test_palette - TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_axisgrid.py::TestPairGrid::test_histplot_legend - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_axisgrid.py::TestPairGrid::test_pairplot_hist - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_axisgrid.py::TestJointPlot::test_hist - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_categorical.py::TestCategoricalPlotter::test_default_palette_with_many_levels - TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 we... FAILED seaborn/tests/test_categorical.py::TestCategoricalPlotter::test_specific_color - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_categorical.py::TestBoxPlotter::test_axes_data - AssertionError: assert 0 == 3 FAILED seaborn/tests/test_categorical.py::TestBoxPlotter::test_draw_missing_boxes - AssertionError: assert 0 == 3 FAILED seaborn/tests/test_categorical.py::TestBoxPlotter::test_missing_data - assert 0 == 3 FAILED seaborn/tests/test_categorical.py::TestCatPlot::test_plot_elements - AssertionError: assert 0 == 3 FAILED seaborn/tests/test_categorical.py::TestBoxenPlotter::test_boxenplots - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_core.py::TestHueMapping::test_hue_map_categorical - TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_distributions.py::TestKDEPlotUnivariate::test_legend - assert (0.3333333333...4313725490196) == (0.8666666666...5686274509804) FAILED seaborn/tests/test_distributions.py::TestKDEPlotBivariate::test_fill_artists - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_distributions.py::TestKDEPlotBivariate::test_common_norm - AttributeError: 'PathCollection' object has no attribute 'get_segments' FAILED seaborn/tests/test_distributions.py::TestKDEPlotBivariate::test_log_scale - AttributeError: 'PathCollection' object has no attribute 'get_segments' FAILED seaborn/tests/test_distributions.py::TestKDEPlotBivariate::test_bandwidth - AttributeError: 'PathCollection' object has no attribute 'get_segments' FAILED seaborn/tests/test_distributions.py::TestKDEPlotBivariate::test_weights - AttributeError: 'PathCollection' object has no attribute 'get_segments' FAILED seaborn/tests/test_distributions.py::TestKDEPlotBivariate::test_hue_ignores_cmap - AttributeError: 'PathCollection' object has no attribute 'get_color' FAILED seaborn/tests/test_distributions.py::TestKDEPlotBivariate::test_contour_line_colors - AttributeError: 'PathCollection' object has no attribute 'get_color' FAILED seaborn/tests/test_distributions.py::TestKDEPlotBivariate::test_contour_fill_colors - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_distributions.py::TestKDEPlotBivariate::test_colorbar - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_distributions.py::TestKDEPlotBivariate::test_levels_and_thresh - AttributeError: 'PathCollection' object has no attribute 'get_segments' FAILED seaborn/tests/test_distributions.py::TestHistPlotBivariate::test_mesh - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_distributions.py::TestHistPlotBivariate::test_mesh_with_hue - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_distributions.py::TestHistPlotBivariate::test_mesh_with_hue_unique_bins - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_distributions.py::TestHistPlotBivariate::test_mesh_with_col_unique_bins - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_distributions.py::TestHistPlotBivariate::test_mesh_log_scale - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_distributions.py::TestHistPlotBivariate::test_mesh_thresh - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_distributions.py::TestHistPlotBivariate::test_mesh_sticky_edges - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_distributions.py::TestHistPlotBivariate::test_mesh_common_norm - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_distributions.py::TestHistPlotBivariate::test_mesh_unique_norm - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_distributions.py::TestHistPlotBivariate::test_mesh_normalization[probability] - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 wer... FAILED seaborn/tests/test_distributions.py::TestHistPlotBivariate::test_mesh_normalization[proportion] - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were... FAILED seaborn/tests/test_distributions.py::TestHistPlotBivariate::test_mesh_normalization[percent] - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_distributions.py::TestHistPlotBivariate::test_mesh_colors - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_distributions.py::TestHistPlotBivariate::test_color_limits - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_distributions.py::TestHistPlotBivariate::test_hue_color_limits - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_distributions.py::TestHistPlotBivariate::test_colorbar - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_distributions.py::TestDisPlot::test_versus_single_histplot[kwargs15] - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_distributions.py::TestDisPlot::test_with_rug[kwargs0] - AttributeError: can't set attribute FAILED seaborn/tests/test_distributions.py::TestDisPlot::test_with_rug[kwargs1] - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_distributions.py::TestDisPlot::test_with_rug[kwargs2] - AttributeError: can't set attribute FAILED seaborn/tests/test_distributions.py::TestDisPlot::test_bivariate_kde_norm - AttributeError: 'PathCollection' object has no attribute 'get_segments' FAILED seaborn/tests/test_distributions.py::TestDisPlot::test_bivariate_hist_norm - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_miscplot.py::TestPalPlot::test_palplot_size - TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_palettes.py::TestColorPalettes::test_big_palette_context - TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_palettes.py::TestColorPalettes::test_palette_size - TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_palettes.py::TestColorPalettes::test_hsluv_palette - TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_palettes.py::TestColorPalettes::test_palette_desat - TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_palettes.py::TestColorPalettes::test_hsluv_values - TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_palettes.py::TestColorPalettes::test_rgb_from_hsluv - TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_palettes.py::TestColorPalettes::test_light_palette - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_palettes.py::TestColorPalettes::test_dark_palette - TypeError: rgb_to_hsluv() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_palettes.py::TestColorPalettes::test_diverging_palette - TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_relational.py::TestRelationalPlotter::test_relplot_stringy_numerics - TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_relational.py::TestLinePlotter::test_plot - TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given FAILED seaborn/tests/test_relational.py::TestScatterPlotter::test_plot - TypeError: _hsluv_to_rgb() takes 1 positional argument but 3 were given =================================================== 60 failed, 965 passed, 23 skipped, 560 warnings in 232.06s (0:03:52) =================================================== ```

Despite that pytest as you see shows DeprecationWarning warnings about still use distutils. That part definitelly is sometbig which should be fixed.

mwaskom commented 2 years ago

On packaging as rpm package it fails because its code contains python 2.x syntax

You keep saying that "its code contains python 2.x syntax" and I have truly no idea what you mean. Seaborn has been running on Python 3 for many years with no issues related to syntax in the husl module.

I would be :-1: on your patch even if you manage to update all of the lines that call into the new library. I am not going to break seaborn API and change the name of the palette just because the husl folks decided to change the name of their library.

kloczek commented 2 years ago

I would be 👎 on your patch even if you manage to update all of the lines that call into the new library. I am not going to break seaborn API and change the name of the palette just because the husl folks decided to change the name of their library.

I'm talkimg about not mantained husl module. Not your seaborn. Is that now clear why I've asked move away fom that module?

mwaskom commented 2 years ago

It really is not clear. I can run seaborn perfectly fine on Python 3 and have never heard otherwise from anyone else until now. If you are talking about a different library, why are you opening an issue on the seaborn repository?

kloczek commented 2 years ago

Again: seaborn depends on husl and THAT module contains py 2.x syntax THAT module and by this it is now disfficult to package it. I have nothint to say about impact of usimg old husl module with seaborn.

mwaskom commented 2 years ago

Again: seaborn depends on husl and THAT module contains py 2.x syntax

These are seaborn's mandatory dependencies:

https://github.com/mwaskom/seaborn/blob/b726628083f56ddec3cf390b2e7e91d9608d88c9/setup.py#L38-L43

kloczek commented 2 years ago

And this is pytest output

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-seaborn-0.11.2-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-seaborn-0.11.2-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -p no:cacheprovider seaborn
ImportError while loading conftest '/home/tkloczko/rpmbuild/BUILD/seaborn-0.11.2/seaborn/conftest.py'.
seaborn/__init__.py:2: in <module>
    from .rcmod import *  # noqa: F401,F403
seaborn/rcmod.py:7: in <module>
    from . import palettes
seaborn/palettes.py:7: in <module>
    import husl
E   ModuleNotFoundError: No module named 'husl'
mwaskom commented 2 years ago

This is what line 7 of palettes.py looks like at the v0.11.2 tag:

https://github.com/mwaskom/seaborn/blob/703259f2dca711205f81d2d8f9e3fa45774eb0da/seaborn/palettes.py#L7

I don't know where you're getting your seaborn source from, but if it doesn't match what's in this repository, I cannot do anything about that.

kloczek commented 2 years ago

Hmm so in this case looks like pytes cannot find that module because is used relative direcory import. I'm using typical "test as installed methodologu which consit from:

Just hads a look one more time on what lands in </install/prefix> and I see:

mwaskom commented 2 years ago

That seems irrelevant to the problem you're having with husl.

kloczek commented 2 years ago

It is revelant becasuse in all packaged pythom modules I'm using "test as installed methodology":

In that case no longer all components involved in testing are in the same tree (sopurce code tree) in which is possible to reach all necessaty components over relative paths. Using relative imports is always bad and may casues many other issues.

mwaskom commented 2 years ago

None of that has anything to do with the fact that you (or whoever you got it from) have changed the source code to import husl as an external package rather than use the vendored version that works perfectly fine on Python 3.

Whether the tests import seaborn modules with relative or absolute paths has nothing to do with the fact that your stacktrace says import husl, and that is not what it says in the canonical version of the seaborn source code.

You have wasted a tremendous amount of my time reporting this issue without sufficient information to understand it, and now that the cause of the problem seems apparent, you don't really seem motivated to actually fix it. I don't see any reason to continue this discussion.