Skip to content

Commit

Permalink
Merge branch 'master' into fix/pointplot_label
Browse files Browse the repository at this point in the history
  • Loading branch information
mwaskom authored Oct 12, 2022
2 parents 02e6267 + 54cab15 commit dc4829c
Show file tree
Hide file tree
Showing 132 changed files with 4,539 additions and 1,253 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
env:
NB_KERNEL: python
MPLBACKEND: Agg
SEABORN_DATA: ${{ github.workspace }}/seaborn-data

jobs:
build-docs:
Expand All @@ -34,9 +35,13 @@ jobs:
sudo apt-get install pandoc
- name: Cache datasets
run: python ci/cache_datasets.py
run: |
git clone https://github.com/mwaskom/seaborn-data.git
ls $SEABORN_DATA
- name: Build docs
env:
SPHINXOPTS: -j `nproc`
run: |
cd doc
make -j `nproc` notebooks
Expand All @@ -49,17 +54,14 @@ jobs:
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10"]
target: [test]
install: [full]
deps: [latest]

include:
- python: "3.7"
target: unittests
install: full
deps: pinned
- python: "3.10"
target: unittests
install: light
deps: latest

Expand All @@ -78,11 +80,8 @@ jobs:
if [[ ${{matrix.deps }} == 'pinned' ]]; then DEPS='-r ci/deps_pinned.txt'; fi
pip install .[dev$EXTRAS] $DEPS
- name: Cache datasets
run: python ci/cache_datasets.py

- name: Run tests
run: make ${{ matrix.target }}
run: make test

- name: Upload coverage
uses: codecov/codecov-action@v2
Expand Down
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
export SHELL := /bin/bash

test:
pytest -n auto --doctest-modules --cov=seaborn --cov=tests --cov-config=.coveragerc seaborn tests

unittests:
pytest -n auto --cov=seaborn --cov=tests --cov-config=.coveragerc tests

lint:
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,9 @@ Testing

Testing seaborn requires installing additional dependencies; they can be installed with the `dev` extra (e.g., `pip install .[dev]`).

To test the code, run `make test` in the source directory. This will exercise both the unit tests and docstring examples (using [pytest](https://docs.pytest.org/)) and generate a coverage report.
To test the code, run `make test` in the source directory. This will exercise the unit tests (using [pytest](https://docs.pytest.org/)) and generate a coverage report.

The doctests require a network connection (unless all example datasets are cached), but the unit tests can be run offline with `make unittests`.

Code style is enforced with `flake8` using the settings in the [`setup.cfg`](./setup.cfg) file. Run `make lint` to check. Alternately, you can use `pre-commit` to automatically run lint checks on any files you are committing – just run `pre-commit install` to set it up, and then commit as usual going forward.
Code style is enforced with `flake8` using the settings in the [`setup.cfg`](./setup.cfg) file. Run `make lint` to check. Alternately, you can use `pre-commit` to automatically run lint checks on any files you are committing: just run `pre-commit install` to set it up, and then commit as usual going forward.

Development
-----------
Expand Down
2 changes: 1 addition & 1 deletion doc/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Building the seaborn docs
=========================

Building the docs requires additional dependencies; they can be installed with `pip install seaborn[docs]`.
Building the docs requires additional dependencies; they can be installed with `pip install seaborn[stats,docs]`.

The build process involves conversion of Jupyter notebooks to `rst` files. To facilitate this, you may need to set `NB_KERNEL` environment variable to the name of a kernel on your machine (e.g. `export NB_KERNEL="python3"`). To get a list of available Python kernels, run `jupyter kernelspec list`.

Expand Down
6 changes: 3 additions & 3 deletions doc/_docstrings/FacetGrid.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "seaborn-py39-latest",
"display_name": "py310",
"language": "python",
"name": "seaborn-py39-latest"
"name": "py310"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -294,7 +294,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.10.0"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions doc/_docstrings/JointGrid.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "seaborn-py39-latest",
"display_name": "py310",
"language": "python",
"name": "seaborn-py39-latest"
"name": "py310"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -236,7 +236,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.10.0"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions doc/_docstrings/PairGrid.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "seaborn-py39-latest",
"display_name": "py310",
"language": "python",
"name": "seaborn-py39-latest"
"name": "py310"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -263,7 +263,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.10.0"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions doc/_docstrings/axes_style.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "seaborn-py39-latest",
"display_name": "py310",
"language": "python",
"name": "seaborn-py39-latest"
"name": "py310"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -94,7 +94,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.10.0"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions doc/_docstrings/barplot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "seaborn-py39-latest",
"display_name": "py310",
"language": "python",
"name": "seaborn-py39-latest"
"name": "py310"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -117,7 +117,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.10.0"
}
},
"nbformat": 4,
Expand Down
103 changes: 103 additions & 0 deletions doc/_docstrings/blend_palette.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "8f97280e-cec8-42b2-a968-4fd4364594f8",
"metadata": {
"tags": [
"hide"
]
},
"outputs": [],
"source": [
"import seaborn as sns\n",
"sns.set_theme()\n",
"sns.palettes._patch_colormap_display()"
]
},
{
"cell_type": "raw",
"id": "972edede-df1a-4010-9674-00b864d020e2",
"metadata": {},
"source": [
"Pass a list of two colors to interpolate between them:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e6ae2547-1042-4ac0-84ea-6f37a0229871",
"metadata": {},
"outputs": [],
"source": [
"sns.blend_palette([\"b\", \"r\"])"
]
},
{
"cell_type": "raw",
"id": "1d983eac-2dd5-4746-b27f-4dfa19b5e091",
"metadata": {},
"source": [
"The color list can be arbitrarily long, and any color format can be used:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "846b78fd-30ce-4507-93f4-4274122c1987",
"metadata": {},
"outputs": [],
"source": [
"sns.blend_palette([\"#45a872\", \".8\", \"xkcd:golden\"])"
]
},
{
"cell_type": "raw",
"id": "318fef32-1f83-44d9-9ff9-21fa0231b7c6",
"metadata": {},
"source": [
"Return a continuous colormap instead of a discrete palette:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f0a05bc3-c60b-47a1-b276-d2e28a4a8226",
"metadata": {},
"outputs": [],
"source": [
"sns.blend_palette([\"#bdc\", \"#7b9\", \"#47a\"], as_cmap=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0473a402-0ec2-4877-81d2-ed6c57aefc77",
"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: 3 additions & 3 deletions doc/_docstrings/boxenplot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "seaborn-py39-latest",
"display_name": "py310",
"language": "python",
"name": "seaborn-py39-latest"
"name": "py310"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -122,7 +122,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.10.0"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions doc/_docstrings/boxplot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "seaborn-py39-latest",
"display_name": "py310",
"language": "python",
"name": "seaborn-py39-latest"
"name": "py310"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -165,7 +165,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.10.0"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions doc/_docstrings/catplot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "seaborn-py39-latest",
"display_name": "py310",
"language": "python",
"name": "seaborn-py39-latest"
"name": "py310"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -182,7 +182,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.10.0"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit dc4829c

Please sign in to comment.