Skip to content

Commit

Permalink
Update version
Browse files Browse the repository at this point in the history
  • Loading branch information
mwaskom committed Dec 18, 2022
2 parents df31a75 + 9bd1665 commit f9f43da
Show file tree
Hide file tree
Showing 29 changed files with 862 additions and 56 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v3

- name: Setup Python 3.10
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: "3.10"

Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
- uses: actions/checkout@v3

- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

Expand All @@ -84,7 +84,7 @@ jobs:
run: make test

- name: Upload coverage
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
if: ${{ success() }}

lint:
Expand All @@ -97,7 +97,7 @@ jobs:
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4

- name: Install tools
run: pip install mypy flake8
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export SHELL := /bin/bash

test:
pytest -n auto --cov=seaborn --cov=tests --cov-config=.coveragerc tests
pytest -n auto --cov=seaborn --cov=tests --cov-config=setup.cfg tests

lint:
flake8 seaborn
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ Documentation

Online documentation is available at [seaborn.pydata.org](https://seaborn.pydata.org).

The docs include a [tutorial](https://seaborn.pydata.org/tutorial.html), [example gallery](https://seaborn.pydata.org/examples/index.html), [API reference](https://seaborn.pydata.org/api.html), and other useful information.
The docs include a [tutorial](https://seaborn.pydata.org/tutorial.html), [example gallery](https://seaborn.pydata.org/examples/index.html), [API reference](https://seaborn.pydata.org/api.html), [FAQ](https://seaborn.pydata.org/faq), and other useful information.

To build the documentation locally, please refer to [`doc/README.md`](doc/README.md).

There is also a [FAQ](https://github.com/mwaskom/seaborn/wiki/Frequently-Asked-Questions-(FAQs)) page, currently hosted on GitHub.

Dependencies
------------

Expand Down
270 changes: 270 additions & 0 deletions doc/_docstrings/objects.KDE.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,270 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "dcc1ae12-bba4-4de9-af8d-543b3d65b42b",
"metadata": {
"tags": [
"hide"
]
},
"outputs": [],
"source": [
"import seaborn.objects as so\n",
"from seaborn import load_dataset\n",
"penguins = load_dataset(\"penguins\")"
]
},
{
"cell_type": "raw",
"id": "1042b991-1471-43bd-934c-43caae3cb2fa",
"metadata": {},
"source": [
"This stat estimates transforms observations into a smooth function representing the estimated density:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2406e2aa-7f0f-4a51-af59-4cef827d28d8",
"metadata": {},
"outputs": [],
"source": [
"p = so.Plot(penguins, x=\"flipper_length_mm\")\n",
"p.add(so.Area(), so.KDE())"
]
},
{
"cell_type": "raw",
"id": "44515f21-683b-420f-967b-4c7568c907d7",
"metadata": {},
"source": [
"Adjust the smoothing bandwidth to see more or fewer details:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d4e6ba5b-4dd2-4210-8cf0-de057dc71e2a",
"metadata": {},
"outputs": [],
"source": [
"p.add(so.Area(), so.KDE(bw_adjust=0.25))"
]
},
{
"cell_type": "raw",
"id": "fd665fe1-a5e4-4742-adc9-e40615d57d08",
"metadata": {},
"source": [
"The curve will extend beyond observed values in the dataset:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4cda1cb8-f663-4f94-aa24-6f1727a41031",
"metadata": {},
"outputs": [],
"source": [
"p2 = p.add(so.Bars(alpha=.3), so.Hist(\"density\"))\n",
"p2.add(so.Line(), so.KDE())"
]
},
{
"cell_type": "raw",
"id": "75235825-d522-4562-aacc-9b7413eabf5d",
"metadata": {},
"source": [
"Control the range of the density curve relative to the observations using `cut`:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a7a9275e-9889-437d-bdc5-18653d2c92ef",
"metadata": {},
"outputs": [],
"source": [
"p2.add(so.Line(), so.KDE(cut=0))"
]
},
{
"cell_type": "raw",
"id": "6a885eeb-81ba-47c6-8402-1bef40544fd1",
"metadata": {},
"source": [
"When observations are assigned to the `y` variable, the density will be shown for `x`:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "38b3a0fb-54ff-493a-bd64-f83a12365723",
"metadata": {},
"outputs": [],
"source": [
"so.Plot(penguins, y=\"flipper_length_mm\").add(so.Area(), so.KDE())"
]
},
{
"cell_type": "raw",
"id": "59996340-168e-479f-a0c6-c7e1fcab0fb0",
"metadata": {},
"source": [
"Use `gridsize` to increase or decrease the resolution of the grid where the density is evaluated:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "23715820-7df9-40ba-9e74-f11564704dd0",
"metadata": {},
"outputs": [],
"source": [
"p.add(so.Dots(), so.KDE(gridsize=100))"
]
},
{
"cell_type": "raw",
"id": "4c9b6492-98c8-45ab-9f53-681cde2f767a",
"metadata": {},
"source": [
"Or pass `None` to evaluate the density at the original datapoints:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4e1b6810-5c28-43aa-aa61-652521299b51",
"metadata": {},
"outputs": [],
"source": [
"p.add(so.Dots(), so.KDE(gridsize=None))"
]
},
{
"cell_type": "raw",
"id": "0970a56b-0cba-4c40-bb1b-b8e71739df5c",
"metadata": {},
"source": [
"Other variables will define groups for the estimation:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5f0ce0b6-5742-4bc0-9ac3-abedde923684",
"metadata": {},
"outputs": [],
"source": [
"p.add(so.Area(), so.KDE(), color=\"species\")"
]
},
{
"cell_type": "raw",
"id": "22204fcd-4b25-46e5-a170-02b1419c23d5",
"metadata": {},
"source": [
"By default, the density is normalized across all groups (i.e., the joint density is shown); pass `common_norm=False` to show conditional densities:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6ad56958-dc45-4632-94d1-23039ad3ec58",
"metadata": {},
"outputs": [],
"source": [
"p.add(so.Area(), so.KDE(common_norm=False), color=\"species\")"
]
},
{
"cell_type": "raw",
"id": "b1627197-85d1-4476-b4ae-3e93044ee988",
"metadata": {},
"source": [
"Or pass a list of variables to condition on:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "58f63734-5afd-4d90-bbfb-fc39c8d1981f",
"metadata": {},
"outputs": [],
"source": [
"(\n",
" p.facet(\"sex\")\n",
" .add(so.Area(), so.KDE(common_norm=[\"col\"]), color=\"species\")\n",
")"
]
},
{
"cell_type": "raw",
"id": "2b7e018e-1374-4939-909c-e95f5ffd086e",
"metadata": {},
"source": [
"This stat can be combined with other transforms, such as :class:`Stack` (when `common_grid=True`):"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "96e5b2d0-c7e2-47df-91f1-7f9ec0bb08a9",
"metadata": {},
"outputs": [],
"source": [
"p.add(so.Area(), so.KDE(), so.Stack(), color=\"sex\")"
]
},
{
"cell_type": "raw",
"id": "8500ff86-0b1f-4831-954b-08b6df690387",
"metadata": {},
"source": [
"Set `cumulative=True` to integrate the density:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "26bb736e-7cfd-421e-b80d-42fa450e88c0",
"metadata": {},
"outputs": [],
"source": [
"p.add(so.Line(), so.KDE(cumulative=True))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e8bfd9d2-ad60-4971-aa7f-71a285f44a20",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "py310",
"language": "python",
"name": "py310"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.0"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
6 changes: 5 additions & 1 deletion doc/_docstrings/objects.Norm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
"cell_type": "code",
"execution_count": null,
"id": "0bfee8b6-1e3e-499d-96ae-735a5c230b32",
"metadata": {},
"metadata": {
"tags": [
"hide"
]
},
"outputs": [],
"source": [
"import seaborn.objects as so\n",
Expand Down
1 change: 1 addition & 0 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Stat objects
Est
Count
Hist
KDE
Perc
PolyFit

Expand Down
2 changes: 1 addition & 1 deletion doc/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ and it can be installed with `conda`::

conda install seaborn

As the main Anaconda repository can be slow to add new releaes, you may prefer using the
As the main Anaconda repository can be slow to add new releases, you may prefer using the
`conda-forge <https://conda-forge.org/>`_ channel::

conda install seaborn -c conda-forge
Expand Down
15 changes: 15 additions & 0 deletions doc/whatsnew/v0.12.2.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

v0.12.2 (Unreleased)
--------------------

- |Feature| Added the :class:`objects.KDE` stat (:pr:`3111`).

- |Enhancement| Automatic mark widths are now calculated separately for unshared facet axes (:pr:`3119`).

- |Fix| Fixed a bug where legends for numeric variables with large values with be incorrectly shown (i.e. with a missing offset or exponent; :pr:`3187`).

- |Fix| Fixed a regression in v0.12.0 where manually-added labels could have duplicate legend entries (:pr:`3116`).

- |Fix| Fixed a bug in :func:`histplot` with `kde=True` and `log_scale=True` where the curve was not scaled properly (:pr:`3173`).

- |Fix| Fixed a bug in :func:`relplot` where inner axis labels would be shown when axis sharing was disabled (:pr:`3180`).
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ dev = [
"mypy",
"pandas-stubs",
"pre-commit",
"flit",
]
docs = [
"numpydoc",
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.12.1"
__version__ = "0.12.2.dev0"
Loading

0 comments on commit f9f43da

Please sign in to comment.