Hello community, here is the log from the commit of package python-seaborn for openSUSE:Factory checked in at 2017-11-08 15:10:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-seaborn (Old) and /work/SRC/openSUSE:Factory/.python-seaborn.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-seaborn" Wed Nov 8 15:10:28 2017 rev:4 rq:538785 version:0.8.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-seaborn/python-seaborn.changes 2017-08-18 15:05:57.589007132 +0200 +++ /work/SRC/openSUSE:Factory/.python-seaborn.new/python-seaborn.changes 2017-11-08 15:10:40.576859442 +0100 @@ -1,0 +2,31 @@ +Thu Nov 2 02:07:08 UTC 2017 - [email protected] + +- update to version 0.8.1: + * Added a warning in :class:`FacetGrid` when passing a categorical + plot function without specifying "order" (or "hue_order" when + "hue" is used), which is likely to produce a plot that is + incorrect. + * Improved compatibility between :class:`FacetGrid` or + :class:`PairGrid` and interactive matplotlib backends so that the + legend no longer remains inside the figure when using + "legend_out=True". + * Changed categorical plot functions with small plot elements to use + :func:`dark_palette` instead of :func:`light_palette` when + generating a sequential palette from a specified color. + * Improved robustness of :func:`kdeplot` and :func:`distplot` to + data with fewer than two observations. + * Fixed a bug in :func:`clustermap` when using "yticklabels=False". + * Fixed a bug in :func:`pointplot` where colors were wrong if + exactly three points were being drawn. + * Fixed a bug in :func:`pointplot` where legend entries for missing + data appeared with empty markers. + * Fixed a bug in :func:`clustermap` where an error was raised when + annotating the main heatmap and showing category colors. + * Fixed a bug in :func:`clustermap` where row labels were not being + properly rotated when they overlapped. + * Fixed a bug in :func:`kdeplot` where the maximum limit on the + density axes was not being updated when multiple densities were + drawn. + * Improved compatibility with future versions of pandas. + +------------------------------------------------------------------- Old: ---- seaborn-0.8.tar.gz New: ---- seaborn-0.8.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-seaborn.spec ++++++ --- /var/tmp/diff_new_pack.vgKRZH/_old 2017-11-08 15:10:41.064841628 +0100 +++ /var/tmp/diff_new_pack.vgKRZH/_new 2017-11-08 15:10:41.068841481 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-seaborn # -# Copyright (c) 2017 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,32 +15,33 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + # Spurious test failures due to upstream changes # Should be fixed in next release after 0.7.1 %bcond_with tests %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-seaborn -Version: 0.8 +Version: 0.8.1 Release: 0 Summary: Statistical data visualization for python License: BSD-3-Clause Group: Development/Languages/Python Url: https://pypi.python.org/pypi/seaborn/ Source: https://files.pythonhosted.org/packages/source/s/seaborn/seaborn-%{version}.tar.gz -BuildRequires: fdupes -BuildRequires: python-rpm-macros -BuildRequires: %{python_module devel} -BuildRequires: %{python_module setuptools} BuildRequires: %{python_module Pillow} +BuildRequires: %{python_module devel} BuildRequires: %{python_module fastcluster} BuildRequires: %{python_module matplotlib} BuildRequires: %{python_module numpy-devel} BuildRequires: %{python_module pandas} BuildRequires: %{python_module patsy} BuildRequires: %{python_module scipy} +BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six} BuildRequires: %{python_module statsmodels} +BuildRequires: fdupes +BuildRequires: python-rpm-macros %if %{with tests} # Testing requirements BuildRequires: %{python_module jupyter_ipython} ++++++ seaborn-0.8.tar.gz -> seaborn-0.8.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/seaborn-0.8/PKG-INFO new/seaborn-0.8.1/PKG-INFO --- old/seaborn-0.8/PKG-INFO 2017-07-09 01:50:49.000000000 +0200 +++ new/seaborn-0.8.1/PKG-INFO 2017-09-03 18:38:20.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: seaborn -Version: 0.8 +Version: 0.8.1 Summary: Seaborn: statistical data visualization Home-page: http://seaborn.pydata.org Author: Michael Waskom diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/seaborn-0.8/README.md new/seaborn-0.8.1/README.md --- old/seaborn-0.8/README.md 2017-07-09 00:55:33.000000000 +0200 +++ new/seaborn-0.8.1/README.md 2017-09-03 18:28:21.000000000 +0200 @@ -43,7 +43,7 @@ Citing ------ -Seaborn can be cited using a DOI provided through Zenodo: ](https://doi.org/10.5281/zenodo.54844) +Seaborn can be cited using a DOI provided through Zenodo: [](https://doi.org/10.5281/zenodo.883859) Dependencies ------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/seaborn-0.8/seaborn/__init__.py new/seaborn-0.8.1/seaborn/__init__.py --- old/seaborn-0.8/seaborn/__init__.py 2017-07-09 01:39:19.000000000 +0200 +++ new/seaborn-0.8.1/seaborn/__init__.py 2017-09-03 18:20:29.000000000 +0200 @@ -18,4 +18,4 @@ from .crayons import crayons from . import cm -__version__ = "0.8.0" +__version__ = "0.8.1" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/seaborn-0.8/seaborn/axisgrid.py new/seaborn-0.8.1/seaborn/axisgrid.py --- old/seaborn-0.8/seaborn/axisgrid.py 2017-07-07 23:08:37.000000000 +0200 +++ new/seaborn-0.8.1/seaborn/axisgrid.py 2017-09-03 00:54:02.000000000 +0200 @@ -93,7 +93,7 @@ figlegend._legend_title_box._text.set_font_properties(prop) # Draw the plot to set the bounding boxes correctly - plt.draw() + self.fig.draw(self.fig.canvas.get_renderer()) # Calculate and set the new width of the figure so the legend fits legend_width = figlegend.get_window_extent().width / self.fig.dpi @@ -101,7 +101,7 @@ self.fig.set_figwidth(figure_width + legend_width) # Draw the plot again to get the new transformations - plt.draw() + self.fig.draw(self.fig.canvas.get_renderer()) # Now calculate how much space we need on the right side legend_width = figlegend.get_window_extent().width / self.fig.dpi @@ -197,7 +197,7 @@ of each facet in inches.\ """), palette=dedent("""\ - palette : seaborn color palette or dict, optional + palette : palette name, list, or dict, optional Colors to use for the different levels of the ``hue`` variable. Should be something that can be interpreted by :func:`color_palette`, or a dictionary mapping hue levels to matplotlib colors.\ @@ -500,7 +500,7 @@ :context: close-figs >>> g = sns.FacetGrid(tips, col="day", size=4, aspect=.5) - >>> g = g.map(sns.boxplot, "time", "total_bill") + >>> g = g.map(plt.hist, "total_bill", bins=bins) Specify the order for plot elements: @@ -549,9 +549,8 @@ :context: close-figs >>> attend = sns.load_dataset("attention") - >>> g = sns.FacetGrid(attend, col="subject", col_wrap=5, - ... size=1.5, ylim=(0, 10)) - >>> g = g.map(sns.pointplot, "solutions", "score", scale=.7) + >>> g = sns.FacetGrid(attend, col="subject", col_wrap=5, size=1.5) + >>> g = g.map(plt.plot, "solutions", "score", marker=".") Define a custom bivariate function to map onto the grid: @@ -695,6 +694,19 @@ # If color was a keyword argument, grab it here kw_color = kwargs.pop("color", None) + # Check for categorical plots without order information + if func.__module__ == "seaborn.categorical": + if "order" not in kwargs: + warning = ("Using the {} function without specifying " + "`order` is likely to produce an incorrect " + "plot.".format(func.__name__)) + warnings.warn(warning) + if len(args) == 3 and "hue_order" not in kwargs: + warning = ("Using the {} function without specifying " + "`hue_order` is likely to produce an incorrect " + "plot.".format(func.__name__)) + warnings.warn(warning) + # Iterate over the data subsets for (row_i, col_j, hue_k), data_ijk in self.facet_data(): @@ -1328,7 +1340,7 @@ self.diag_axes = np.array(diag_axes, np.object) # Plot on each of the diagonal axes - color = kwargs.pop('color', None) + fixed_color = kwargs.pop("color", None) for i, var in enumerate(self.x_vars): ax = self.diag_axes[i] hue_grouped = self.data[var].groupby(self.hue_vals) @@ -1336,6 +1348,7 @@ # Special-case plt.hist with stacked bars if func is plt.hist: plt.sca(ax) + vals = [] for label in self.hue_names: # Attempt to get data for this level, allowing for empty @@ -1344,26 +1357,30 @@ except KeyError: vals.append(np.array([])) - if color is None: - color = self.palette - # check and see if histtype override was provided in kwargs - if 'histtype' in kwargs: + color = self.palette if fixed_color is None else fixed_color + + if "histtype" in kwargs: func(vals, color=color, **kwargs) else: - func(vals, color=color, histtype="barstacked", - **kwargs) + func(vals, color=color, histtype="barstacked", **kwargs) + else: + plt.sca(ax) + for k, label_k in enumerate(self.hue_names): + # Attempt to get data for this level, allowing for empty try: data_k = hue_grouped.get_group(label_k) except KeyError: data_k = np.array([]) - plt.sca(ax) - if color is None: + + if fixed_color is None: color = self.palette[k] - func(data_k, label=label_k, - color=color, **kwargs) + else: + color = fixed_color + + func(data_k, label=label_k, color=color, **kwargs) self._clean_axis(ax) @@ -1871,7 +1888,7 @@ variables on the rows and columns. This is a high-level interface for :class:`PairGrid` that is intended to - make it easy to draw a few common styles. You should use :class`PairGrid` + make it easy to draw a few common styles. You should use :class:`PairGrid` directly if you need more flexibility. Parameters @@ -2004,6 +2021,11 @@ ... diag_kws=dict(shade=True)) """ + if not isinstance(data, pd.DataFrame): + raise TypeError( + "'data' must be pandas DataFrame object, not: {typefound}".format( + typefound=type(data))) + if plot_kws is None: plot_kws = {} if diag_kws is None: @@ -2028,8 +2050,8 @@ if not isinstance(markers, list): markers = [markers] * n_markers if len(markers) != n_markers: - raise ValueError(("markers must be a singeton or a list of markers" - " for each level of the hue variable")) + raise ValueError(("markers must be a singleton or a list of " + "markers for each level of the hue variable")) grid.hue_kws = {"marker": markers} # Maybe plot on the diagonal diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/seaborn-0.8/seaborn/categorical.py new/seaborn-0.8.1/seaborn/categorical.py --- old/seaborn-0.8/seaborn/categorical.py 2017-07-07 23:08:37.000000000 +0200 +++ new/seaborn-0.8.1/seaborn/categorical.py 2017-09-03 00:54:02.000000000 +0200 @@ -4,7 +4,6 @@ import numpy as np from scipy import stats import pandas as pd -from pandas.core.series import remove_na import matplotlib as mpl from matplotlib.collections import PatchCollection import matplotlib.patches as Patches @@ -15,9 +14,9 @@ from .external.six.moves import range from . import utils -from .utils import iqr, categorical_order +from .utils import iqr, categorical_order, remove_na from .algorithms import bootstrap -from .palettes import color_palette, husl_palette, light_palette +from .palettes import color_palette, husl_palette, light_palette, dark_palette from .axisgrid import FacetGrid, _facet_docs @@ -28,6 +27,7 @@ class _CategoricalPlotter(object): width = .8 + default_palette = "light" def establish_variables(self, x=None, y=None, hue=None, data=None, orient=None, order=None, hue_order=None, @@ -281,7 +281,12 @@ if self.hue_names is None: colors = [color] * n_colors else: - colors = light_palette(color, n_colors) + if self.default_palette == "light": + colors = light_palette(color, n_colors) + elif self.default_palette == "dark": + colors = dark_palette(color, n_colors) + else: + raise RuntimeError("No default palette specified") else: # Let `palette` be a dict mapping level to color @@ -317,7 +322,10 @@ def is_categorical(s): try: # Correct way, but doesnt exist in older Pandas - return pd.core.common.is_categorical_dtype(s) + try: + return pd.api.types.is_categorical_dtype(s) + except AttributeError: + return pd.core.common.is_categorical_dtype(s) except AttributeError: # Also works, but feels hackier return str(s.dtype) == "categorical" @@ -1077,6 +1085,8 @@ class _CategoricalScatterPlotter(_CategoricalPlotter): + default_palette = "dark" + @property def point_colors(self): """Return a color for each scatter point based on group and hue.""" @@ -1644,6 +1654,9 @@ class _PointPlotter(_CategoricalStatPlotter): + + default_palette = "dark" + """Show point estimates and confidence intervals with (joined) points.""" def __init__(self, x, y, hue, data, order, hue_order, estimator, ci, n_boot, units, @@ -1720,16 +1733,17 @@ # Draw the confidence intervals self.draw_confints(ax, pointpos, self.confint, self.colors, self.errwidth, self.capsize) + # Draw the estimate points marker = self.markers[0] + hex_colors = [mpl.colors.rgb2hex(c) for c in self.colors] if self.orient == "h": - ax.scatter(self.statistic, pointpos, - linewidth=mew, marker=marker, s=markersize, - c=self.colors, edgecolor=self.colors) + x, y = self.statistic, pointpos else: - ax.scatter(pointpos, self.statistic, - linewidth=mew, marker=marker, s=markersize, - c=self.colors, edgecolor=self.colors) + x, y = pointpos, self.statistic + ax.scatter(x, y, + linewidth=mew, marker=marker, s=markersize, + c=hex_colors, edgecolor=hex_colors) else: @@ -1763,17 +1777,23 @@ zorder=z) # Draw the estimate points + n_points = len(remove_na(offpos)) marker = self.markers[j] + hex_color = mpl.colors.rgb2hex(self.colors[j]) + if n_points: + point_colors = [hex_color for _ in range(n_points)] + else: + point_colors = hex_color if self.orient == "h": - ax.scatter(statistic, offpos, label=hue_level, - c=[self.colors[j]] * len(offpos), - linewidth=mew, marker=marker, s=markersize, - edgecolor=self.colors[j], zorder=z) + x, y = statistic, offpos else: - ax.scatter(offpos, statistic, label=hue_level, - c=[self.colors[j]] * len(offpos), - linewidth=mew, marker=marker, s=markersize, - edgecolor=self.colors[j], zorder=z) + x, y = offpos, statistic + if not len(remove_na(statistic)): + x, y = [], [] + ax.scatter(x, y, label=hue_level, + c=point_colors, edgecolor=point_colors, + linewidth=mew, marker=marker, s=markersize, + zorder=z) def plot(self, ax): """Make the plot.""" @@ -2080,7 +2100,7 @@ ci : float or "sd" or None, optional Size of confidence intervals to draw around estimated values. If "sd", skip bootstrapping and draw the standard deviation of the - observerations. If ``None``, no bootstrapping will be performed, and + observations. If ``None``, no bootstrapping will be performed, and error bars will not be drawn. n_boot : int, optional Number of bootstrap iterations to use when computing confidence @@ -2098,8 +2118,7 @@ """), color=dedent("""\ color : matplotlib color, optional - Color for all of the elements, or seed for :func:`light_palette` when - using hue nesting.\ + Color for all of the elements, or seed for a gradient palette. """), palette=dedent("""\ palette : palette name, list, or dict, optional @@ -2980,10 +2999,10 @@ {saturation} errcolor : matplotlib color Color for the lines that represent the confidence interval. - {ax_in} {errwidth} {capsize} {dodge} + {ax_in} kwargs : key, value mappings Other keyword arguments are passed through to ``plt.bar`` at draw time. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/seaborn-0.8/seaborn/distributions.py new/seaborn-0.8.1/seaborn/distributions.py --- old/seaborn-0.8/seaborn/distributions.py 2017-07-07 23:08:37.000000000 +0200 +++ new/seaborn-0.8.1/seaborn/distributions.py 2017-09-03 00:54:02.000000000 +0200 @@ -26,6 +26,8 @@ """Calculate number of hist bins using Freedman-Diaconis rule.""" # From http://stats.stackexchange.com/questions/798/ a = np.asarray(a) + if len(a) < 2: + return 1 h = 2 * iqr(a) / (len(a) ** (1 / 3)) # fall back to sqrt(a) bins if iqr is 0 if h == 0: @@ -168,7 +170,9 @@ label_ax = True # Make a a 1-d array - a = np.asarray(a).squeeze() + a = np.asarray(a) + if a.ndim > 1: + a = a.squeeze() # Decide if the hist is normed norm_hist = norm_hist or kde or (fit is not None) @@ -298,25 +302,33 @@ label = "_nolegend_" if label is None else label # Use the active color cycle to find the plot color + facecolor = kwargs.pop("facecolor", None) line, = ax.plot(x, y, **kwargs) color = line.get_color() line.remove() kwargs.pop("color", None) + facecolor = color if facecolor is None else facecolor # Draw the KDE plot and, optionally, shade ax.plot(x, y, color=color, label=label, **kwargs) - alpha = kwargs.get("alpha", 0.25) + shade_kws = dict( + facecolor=facecolor, + alpha=kwargs.get("alpha", 0.25), + clip_on=kwargs.get("clip_on", True), + zorder=kwargs.get("zorder", 1), + ) if shade: if vertical: - ax.fill_betweenx(y, 0, x, facecolor=color, alpha=alpha) + ax.fill_betweenx(y, 0, x, **shade_kws) else: - ax.fill_between(x, 0, y, facecolor=color, alpha=alpha) + ax.fill_between(x, 0, y, **shade_kws) # Set the density axis minimum to 0 + xmargin, ymargin = ax.margins() if vertical: - ax.set_xlim(0, None) + ax.set_xlim(0, max(ax.get_xlim()[1], (1 + xmargin) * x.max())) else: - ax.set_ylim(0, None) + ax.set_ylim(0, max(ax.get_ylim()[1], (1 + ymargin) * y.max())) # Draw the legend here if legend: @@ -601,6 +613,9 @@ if isinstance(data, list): data = np.asarray(data) + if len(data) == 0: + return ax + data = data.astype(np.float64) if data2 is not None: if isinstance(data2, list): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/seaborn-0.8/seaborn/matrix.py new/seaborn-0.8.1/seaborn/matrix.py --- old/seaborn-0.8/seaborn/matrix.py 2017-07-07 23:08:37.000000000 +0200 +++ new/seaborn-0.8.1/seaborn/matrix.py 2017-09-03 00:54:02.000000000 +0200 @@ -312,7 +312,7 @@ ytl = ax.set_yticklabels(yticklabels, rotation="vertical") # Possibly rotate them if they overlap - plt.draw() + ax.figure.draw(ax.figure.canvas.get_renderer()) if axis_ticklabels_overlap(xtl): plt.setp(xtl, rotation="vertical") if axis_ticklabels_overlap(ytl): @@ -697,7 +697,7 @@ ytl = ax.set_yticklabels(self.yticklabels, rotation='vertical') # Force a draw of the plot to avoid matplotlib window error - plt.draw() + ax.figure.draw(ax.figure.canvas.get_renderer()) if len(ytl) > 0 and axis_ticklabels_overlap(ytl): plt.setp(ytl, rotation="horizontal") if len(xtl) > 0 and axis_ticklabels_overlap(xtl): @@ -1048,6 +1048,7 @@ kws = kws.copy() kws.pop('cmap', None) kws.pop('center', None) + kws.pop('annot', None) kws.pop('vmin', None) kws.pop('vmax', None) kws.pop('robust', None) @@ -1115,14 +1116,13 @@ cbar_kws=colorbar_kws, mask=self.mask, xticklabels=xtl, yticklabels=ytl, **kws) - xtl_rot = self.ax_heatmap.get_xticklabels()[0].get_rotation() - ytl_rot = self.ax_heatmap.get_yticklabels()[0].get_rotation() - + ytl = self.ax_heatmap.get_yticklabels() + ytl_rot = None if not ytl else ytl[0].get_rotation() self.ax_heatmap.yaxis.set_ticks_position('right') self.ax_heatmap.yaxis.set_label_position('right') - - plt.setp(self.ax_heatmap.get_xticklabels(), rotation=xtl_rot) - plt.setp(self.ax_heatmap.get_yticklabels(), rotation=ytl_rot) + if ytl_rot is not None: + ytl = self.ax_heatmap.get_yticklabels() + plt.setp(ytl, rotation=ytl_rot) def plot(self, metric, method, colorbar_kws, row_cluster, col_cluster, row_linkage, col_linkage, **kws): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/seaborn-0.8/seaborn/tests/test_axisgrid.py new/seaborn-0.8.1/seaborn/tests/test_axisgrid.py --- old/seaborn-0.8/seaborn/tests/test_axisgrid.py 2017-07-07 23:08:37.000000000 +0200 +++ new/seaborn-0.8.1/seaborn/tests/test_axisgrid.py 2017-09-03 00:54:02.000000000 +0200 @@ -475,7 +475,7 @@ x, y = np.arange(10), np.arange(10) df = pd.DataFrame(np.c_[x, y], columns=["x", "y"]) - g = ag.FacetGrid(df).map(pointplot, "x", "y") + g = ag.FacetGrid(df).map(pointplot, "x", "y", order=x) g.set_xticklabels(step=2) got_x = [int(l.get_text()) for l in g.axes[0, 0].get_xticklabels()] npt.assert_array_equal(x[::2], got_x) @@ -727,6 +727,14 @@ nt.assert_equal(g.axes.shape, (len(df['a'].cat.categories),)) + def test_categorical_warning(self): + + g = ag.FacetGrid(self.df, col="b") + with warnings.catch_warnings(): + warnings.resetwarnings() + warnings.simplefilter("always") + npt.assert_warns(UserWarning, g.map, pointplot, "b", "x") + class TestPairGrid(PlotTestCase): @@ -955,6 +963,17 @@ nt.assert_equals(line.get_color(), color) @skipif(old_matplotlib) + def test_map_diag_palette(self): + + pal = color_palette(n_colors=len(self.df.a.unique())) + g = ag.PairGrid(self.df, hue="a") + g.map_diag(kdeplot) + + for ax in g.diag_axes: + for line, color in zip(ax.lines, pal): + nt.assert_equals(line.get_color(), color) + + @skipif(old_matplotlib) def test_map_diag_and_offdiag(self): vars = ["x", "y", "z"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/seaborn-0.8/seaborn/tests/test_categorical.py new/seaborn-0.8.1/seaborn/tests/test_categorical.py --- old/seaborn-0.8/seaborn/tests/test_categorical.py 2017-07-07 23:08:37.000000000 +0200 +++ new/seaborn-0.8.1/seaborn/tests/test_categorical.py 2017-09-03 00:54:02.000000000 +0200 @@ -4,6 +4,7 @@ from scipy import stats, spatial import matplotlib as mpl import matplotlib.pyplot as plt +from matplotlib.colors import rgb2hex from distutils.version import LooseVersion @@ -2213,7 +2214,7 @@ nt.assert_equal(line.get_color(), color[:-1]) for got_color in ax.collections[0].get_facecolors(): - npt.assert_array_equal(got_color, color) + npt.assert_array_equal(rgb2hex(got_color), rgb2hex(color)) plt.close("all") @@ -2232,7 +2233,7 @@ for point_color, pal_color in zip(ax.collections[0].get_facecolors(), palette): - npt.assert_array_equal(point_color[:-1], pal_color) + npt.assert_array_equal(rgb2hex(point_color), rgb2hex(pal_color)) plt.close("all") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/seaborn-0.8/seaborn/tests/test_matrix.py new/seaborn-0.8.1/seaborn/tests/test_matrix.py --- old/seaborn-0.8/seaborn/tests/test_matrix.py 2017-07-03 19:54:30.000000000 +0200 +++ new/seaborn-0.8.1/seaborn/tests/test_matrix.py 2017-09-03 00:54:02.000000000 +0200 @@ -1084,3 +1084,16 @@ npt.assert_array_equal(xtl_actual, xtl_want) npt.assert_array_equal(ytl_actual, ytl_want) + + def test_noticklabels(self): + + kws = self.default_kws.copy() + kws["xticklabels"] = False + kws["yticklabels"] = False + + g = mat.clustermap(self.df_norm, **kws) + + xtl_actual = [t.get_text() for t in g.ax_heatmap.get_xticklabels()] + ytl_actual = [t.get_text() for t in g.ax_heatmap.get_yticklabels()] + nt.assert_equal(xtl_actual, []) + nt.assert_equal(ytl_actual, []) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/seaborn-0.8/seaborn/tests/test_utils.py new/seaborn-0.8.1/seaborn/tests/test_utils.py --- old/seaborn-0.8/seaborn/tests/test_utils.py 2017-07-07 23:08:37.000000000 +0200 +++ new/seaborn-0.8.1/seaborn/tests/test_utils.py 2017-09-03 00:54:02.000000000 +0200 @@ -374,3 +374,14 @@ for lum1, lum2 in zip(lums1, lums2): nose.tools.assert_almost_equal(lum1, lum2) + + +def test_remove_na(): + + a_array = np.array([1, 2, np.nan, 3]) + a_array_rm = utils.remove_na(a_array) + npt.assert_array_equal(a_array_rm, np.array([1, 2, 3])) + + a_series = pd.Series([1, 2, np.nan, 3]) + a_series_rm = utils.remove_na(a_series) + pdt.assert_series_equal(a_series_rm, pd.Series([1., 2, 3], [0, 1, 3])) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/seaborn-0.8/seaborn/utils.py new/seaborn-0.8.1/seaborn/utils.py --- old/seaborn-0.8/seaborn/utils.py 2017-07-07 23:08:37.000000000 +0200 +++ new/seaborn-0.8.1/seaborn/utils.py 2017-09-03 00:54:02.000000000 +0200 @@ -1,7 +1,6 @@ """Small plotting-related utility functions.""" from __future__ import print_function, division import colorsys -import warnings import os import numpy as np @@ -22,6 +21,23 @@ "despine", "get_dataset_names", "load_dataset"] +def remove_na(arr): + """Helper method for removing NA values from array-like. + + Parameters + ---------- + arr : array-like + The array-like from which to remove NA values. + + Returns + ------- + clean_arr : array-like + The original array with NA values removed. + + """ + return arr[pd.notnull(arr)] + + def ci_to_errsize(cis, heights): """Convert intervals to error arguments relative to plot heights. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/seaborn-0.8/seaborn.egg-info/PKG-INFO new/seaborn-0.8.1/seaborn.egg-info/PKG-INFO --- old/seaborn-0.8/seaborn.egg-info/PKG-INFO 2017-07-09 01:50:48.000000000 +0200 +++ new/seaborn-0.8.1/seaborn.egg-info/PKG-INFO 2017-09-03 18:38:20.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: seaborn -Version: 0.8 +Version: 0.8.1 Summary: Seaborn: statistical data visualization Home-page: http://seaborn.pydata.org Author: Michael Waskom diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/seaborn-0.8/setup.cfg new/seaborn-0.8.1/setup.cfg --- old/seaborn-0.8/setup.cfg 2017-07-09 01:50:49.000000000 +0200 +++ new/seaborn-0.8.1/setup.cfg 2017-09-03 18:38:20.000000000 +0200 @@ -1,5 +1,4 @@ [egg_info] tag_build = tag_date = 0 -tag_svn_revision = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/seaborn-0.8/setup.py new/seaborn-0.8.1/setup.py --- old/seaborn-0.8/setup.py 2017-07-09 01:50:14.000000000 +0200 +++ new/seaborn-0.8.1/setup.py 2017-09-03 18:20:10.000000000 +0200 @@ -28,7 +28,7 @@ URL = 'http://seaborn.pydata.org' LICENSE = 'BSD (3-clause)' DOWNLOAD_URL = 'https://github.com/mwaskom/seaborn/' -VERSION = '0.8' +VERSION = '0.8.1' try: from setuptools import setup
