Skip to content

Commit

Permalink
Merge master and update version for release
Browse files Browse the repository at this point in the history
  • Loading branch information
mwaskom committed Dec 31, 2023
2 parents f2abeb0 + 6890b31 commit d00a27d
Show file tree
Hide file tree
Showing 48 changed files with 560 additions and 342 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ If you think you've encountered a bug in seaborn, please report it on the [Githu
- A clear explanation of why you think something is wrong
- The specific versions of seaborn and matplotlib that you are working with

Bug reports are easiest to address if they can be demonstrated using one of the example datasets from the seaborn docs (i.e. with `seaborn.load_dataset`). Otherwise, it is preferable that your example generate synthetic data to reproduce the problem. If you can only demonstrate the issue with your actual dataset, you will need to share it, ideally as a csv. Note that you can upload a csv directly to a github issue thread, but it must have a `.txt` suffix.
Bug reports are easiest to address if they can be demonstrated using one of the example datasets from the seaborn docs (i.e. with `seaborn.load_dataset`). Otherwise, it is preferable that your example generate synthetic data to reproduce the problem. If you can only demonstrate the issue with your actual dataset, you will need to share it, ideally as a csv (do not share data as a pickle file).

If you've encountered an error, searching the specific text of the message before opening a new issue can often help you solve the problem quickly and avoid making a duplicate report.

Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ env:
NB_KERNEL: python
MPLBACKEND: Agg
SEABORN_DATA: ${{ github.workspace }}/seaborn-data
PYDEVD_DISABLE_FILE_VALIDATION: 1

jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Setup Python 3.11
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: "3.11"

Expand All @@ -35,7 +36,8 @@ jobs:
- name: Install pandoc
run: |
sudo apt-get install pandoc
wget https://github.com/jgm/pandoc/releases/download/3.1.11/pandoc-3.1.11-1-amd64.deb
sudo dpkg -i pandoc-3.1.11-1-amd64.deb
- name: Cache datasets
run: |
Expand All @@ -56,7 +58,7 @@ jobs:

strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11"]
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
install: [full]
deps: [latest]

Expand All @@ -69,12 +71,13 @@ jobs:
deps: latest

steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: ${{ matrix.python }}
allow-prereleases: true

- name: Install seaborn
run: |
Expand All @@ -97,10 +100,10 @@ jobs:
steps:

- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Setup Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0

- name: Install tools
run: pip install mypy flake8
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2012-2021, Michael L. Waskom
Copyright (c) 2012-2023, Michael L. Waskom
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ seaborn: statistical data visualization
=======================================

[![PyPI Version](https://img.shields.io/pypi/v/seaborn.svg)](https://pypi.org/project/seaborn/)
[![License](https://img.shields.io/pypi/l/seaborn.svg)](https://github.com/mwaskom/seaborn/blob/master/LICENSE)
[![License](https://img.shields.io/pypi/l/seaborn.svg)](https://github.com/mwaskom/seaborn/blob/master/LICENSE.md)
[![DOI](https://joss.theoj.org/papers/10.21105/joss.03021/status.svg)](https://doi.org/10.21105/joss.03021)
[![Tests](https://github.com/mwaskom/seaborn/workflows/CI/badge.svg)](https://github.com/mwaskom/seaborn/actions)
[![Code Coverage](https://codecov.io/gh/mwaskom/seaborn/branch/master/graph/badge.svg)](https://codecov.io/gh/mwaskom/seaborn)
Expand Down
2 changes: 1 addition & 1 deletion doc/_docstrings/barplot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"id": "b53b65b8-5670-4905-aa39-36db04f4b813",
"metadata": {},
"source": [
"With long data, assign `x` and `y` to group by a categorical varaible and plot aggregated values, with confidence intervals:"
"With long data, assign `x` and `y` to group by a categorical variable and plot aggregated values, with confidence intervals:"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion doc/_docstrings/histplot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Step functions, esepcially when unfilled, make it easy to compare cumulative histograms:"
"Step functions, especially when unfilled, make it easy to compare cumulative histograms:"
]
},
{
Expand Down
18 changes: 18 additions & 0 deletions doc/_docstrings/objects.Est.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,30 @@
"p.add(so.Range(), so.Est(seed=0))"
]
},
{
"cell_type": "markdown",
"id": "df807ef8-b5fb-4eac-b539-1bd4e797ddc2",
"metadata": {},
"source": [
"To compute a weighted estimate (and confidence interval), assign a `weight` variable in the layer where you use the stat:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5e4a0594-e1ee-4f72-971e-3763dd626e8b",
"metadata": {},
"outputs": [],
"source": [
"p.add(so.Range(), so.Est(), weight=\"price\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0d0c34d7-fb76-44cf-9079-3ec7f45741d0",
"metadata": {},
"outputs": [],
"source": []
}
],
Expand Down
20 changes: 19 additions & 1 deletion doc/_docstrings/objects.Plot.layout.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,28 @@
"p.facet([\"A\", \"B\"], [\"X\", \"Y\"]).layout(engine=\"constrained\")"
]
},
{
"cell_type": "markdown",
"id": "d61054d1-dcef-4e11-9802-394bcc633f9f",
"metadata": {},
"source": [
"With `extent`, you can control the size of the plot relative to the underlying figure. Because the notebook display adapts the figure background to the plot, this appears only to change the plot size in a notebook context. But it can be useful when saving or displaying through a `pyplot` GUI window:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1b5d5969-2925-474f-8e3c-99e4f90a7a2b",
"metadata": {},
"outputs": [],
"source": [
"p.layout(extent=[0, 0, .8, 1]).show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "781ff58c-b805-4e93-8cae-be0442e273ea",
"id": "e5c41b7d-a064-4406-8571-a544b194f3dc",
"metadata": {},
"outputs": [],
"source": []
Expand Down
6 changes: 3 additions & 3 deletions doc/_docstrings/pointplot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"id": "f25d3647-9fad-47b2-b49d-db6f5b5c3795",
"metadata": {},
"source": [
"Group by a categorical varaible and plot aggregated values, with confidence intervals:"
"Group by a categorical variable and plot aggregated values, with confidence intervals:"
]
},
{
Expand Down Expand Up @@ -138,7 +138,7 @@
"id": "00273ada-cd12-410a-a268-38243d6514ae",
"metadata": {},
"source": [
"Dodge by a specific amount, relative to the width alloted for each level:"
"Dodge by a specific amount, relative to the width allotted for each level:"
]
},
{
Expand All @@ -164,7 +164,7 @@
"id": "e205e7c8-6b11-44e6-b43f-7416c427215d",
"metadata": {},
"source": [
"When variables are not explicity assigned and the dataset is two-dimensional, the plot will aggregate over each column:"
"When variables are not explicitly assigned and the dataset is two-dimensional, the plot will aggregate over each column:"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion doc/_docstrings/scatterplot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
"cell_type": "raw",
"metadata": {},
"source": [
"Control the range of marker areas with ``sizes``, and set ``lengend=\"full\"`` to force every unique value to appear in the legend:"
"Control the range of marker areas with ``sizes``, and set ``legend=\"full\"`` to force every unique value to appear in the legend:"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion doc/_tutorial/color_palettes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@
"source": [
"As you can see, there are many options for using color in your visualizations. Seaborn tries both to use good defaults and to offer a lot of flexibility.\n",
"\n",
"This discussion is only the beginning, and there are a number of good resources for learning more about techniques for using color in visualizations. One great example is this `series of blog posts <https://earthobservatory.nasa.gov/blogs/elegantfigures/2013/08/05/subtleties-of-color-part-1-of-6/>`_ from the NASA Earth Observatory. The matplotlib docs also have a `nice tutorial <https://matplotlib.org/users/colormaps.html>`_ that illustrates some of the perceptual properties of their colormaps."
"This discussion is only the beginning, and there are a number of good resources for learning more about techniques for using color in visualizations. One great example is this `series of blog posts <https://earthobservatory.nasa.gov/blogs/elegantfigures/2013/08/05/subtleties-of-color-part-1-of-6/>`_ from the NASA Earth Observatory. The matplotlib docs also have a `nice tutorial <https://matplotlib.org/stable/users/explain/colors/colormaps.html>`_ that illustrates some of the perceptual properties of their colormaps."
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion doc/_tutorial/data_structure.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"As a data visualization library, seaborn requires that you provide it with data. This chapter explains the various ways to accomplish that task. Seaborn supports several different dataset formats, and most functions accept data represented with objects from the `pandas <https://pandas.pydata.org/>`_ or `numpy <https://numpy.org/>`_ libraries as well as built-in Python types like lists and dictionaries. Understanding the usage patterns associated with these different options will help you quickly create useful visualizations for nearly any dataset.\n",
"\n",
".. note::\n",
" As of current writing (v0.13.0), the full breadth of options covered here are supported by most, but not all, of the functions in seaborn. Namely, a few older functinos (e.g., :func:`lmplot` and :func:`regplot`) anre more limited in what they accept."
" As of current writing (v0.13.0), the full breadth of options covered here are supported by most, but not all, of the functions in seaborn. Namely, a few older functions (e.g., :func:`lmplot` and :func:`regplot`) are more limited in what they accept."
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion doc/_tutorial/properties.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@
"\n",
"The `pointsize` property is relevant to dot marks and to line marks that can show markers at individual data points. The units correspond to the diameter of the mark in points.\n",
"\n",
"The `pointsize` scales with the square root of the data by default so that magnitude is represented by diameter rather than area:"
"Note that, while the parameterization corresponds to diameter, scales will be applied with a square root transform so that data values are linearly proportional to area:"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"""

# Define replacements (used in whatsnew bullets)
rst_epilog = """
rst_epilog = r"""
.. role:: raw-html(raw)
:format: html
Expand Down
2 changes: 1 addition & 1 deletion doc/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ if you try to reproduce the issue in an example that uses only matplotlib,
so that you can report it in the right place. But it is alright to skip this
step if it's not obvious how to do it.

General support questions are more at home on either `stackoverflow
General support questions are more at home on `stackoverflow
<https://stackoverflow.com/questions/tagged/seaborn/>`_, where there is a
larger audience of people who will see your post and may be able to offer
assistance. Your chance of getting a quick answer will be higher if you include
Expand Down
1 change: 1 addition & 0 deletions doc/whatsnew/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ v0.13
.. toctree::
:maxdepth: 2

v0.13.1
v0.13.0

v0.12
Expand Down
22 changes: 22 additions & 0 deletions doc/whatsnew/v0.13.1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
v0.13.1 (December 2023)
-----------------------

This is a minor release with some bug fixes and a couple new features. All users are encouraged to update.

- |Feature| Added support for weighted mean estimation (with boostrap CIs) in :func:`lineplot`, :func:`barplot`, :func:`pointplot`, and :class:`objects.Est` (:pr:`3580`, :pr:`3586`).

- |Feature| Added the `extent` option to :meth:`objects.Plot.layout` (:pr:`3552`).

- |Fix| Fixed a regression in v0.13.0 that triggered an exception when working with non-numpy data types (:pr:`3516`).

- |Fix| Fixed a bug in :class:`objects.Plot` so that tick labels are shown for wrapped axes that aren't in the bottom-most row (:pr:`3600`).

- |Fix| Fixed a bug in :func:`catplot` where a blank legend would be added when `hue` was redundantly assigned (:pr:`3540`).

- |Fix| Fixed a bug in :func:`catplot` where the `edgecolor` parameter was ignored with `kind="bar"` (:pr:`3547`).

- |Fix| Fixed a bug in :func:`boxplot` where an exception was raised when using the matplotlib `bootstrap` option (:pr:`3562`).

- |Fix| Fixed a bug in :func:`lineplot` where an exception was raised when `hue` was assigned with an empty dataframe (:pr:`3569`).

- |Fix| Fixed a bug in multiple categorical plots that raised with `hue=None` and `dodge=True`; this is now has no effect (:pr:`3605`).
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: BSD License",
"Topic :: Scientific/Engineering :: Visualization",
"Topic :: Multimedia :: Graphics",
Expand All @@ -25,7 +26,7 @@ requires-python = ">=3.8"
dependencies = [
"numpy>=1.20,!=1.24.0",
"pandas>=1.2",
"matplotlib>=3.3,!=3.6.1",
"matplotlib>=3.4,!=3.6.1",
]

[project.optional-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion seaborn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
_orig_rc_params = mpl.rcParams.copy()

# Define the seaborn version
__version__ = "0.13.0"
__version__ = "0.13.1"
18 changes: 10 additions & 8 deletions seaborn/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,8 @@ def iter_data(

grouping_keys = []
for var in grouping_vars:
grouping_keys.append(levels.get(var, []))
key = levels.get(var)
grouping_keys.append([] if key is None else key)

iter_keys = itertools.product(*grouping_keys)
if reverse:
Expand Down Expand Up @@ -1159,11 +1160,7 @@ def _attach(
# For categorical y, we want the "first" level to be at the top of the axis
if self.var_types.get("y", None) == "categorical":
for ax in ax_list:
try:
ax.yaxis.set_inverted(True)
except AttributeError: # mpl < 3.1
if not ax.yaxis_inverted():
ax.invert_yaxis()
ax.yaxis.set_inverted(True)

# TODO -- Add axes labels

Expand Down Expand Up @@ -1520,8 +1517,13 @@ def variable_type(vector, boolean_type="numeric"):
warnings.simplefilter(
action='ignore', category=(FutureWarning, DeprecationWarning)
)
if np.isin(vector, [0, 1]).all():
return VariableType(boolean_type)
try:
if np.isin(vector, [0, 1]).all():
return VariableType(boolean_type)
except TypeError:
# .isin comparison is not guaranteed to be possible under NumPy
# casting rules, depending on the (unknown) dtype of 'vector'
pass

# Defer to positive pandas tests
if pd.api.types.is_numeric_dtype(vector):
Expand Down
Loading

0 comments on commit d00a27d

Please sign in to comment.