Skip to content

Commit

Permalink
Merge pull request #2810 from mwaskom/nextgen/main
Browse files Browse the repository at this point in the history
Prototype of next-generation interface
  • Loading branch information
mwaskom authored May 16, 2022
2 parents 04bce13 + 4033caf commit 0550195
Show file tree
Hide file tree
Showing 69 changed files with 11,961 additions and 29 deletions.
7 changes: 6 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@ omit =
seaborn/colors/*
seaborn/cm.py
seaborn/conftest.py
seaborn/tests/*

[report]
exclude_lines =
pragma: no cover
if TYPE_CHECKING:
raise NotImplementedError
25 changes: 23 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
push:
branches: master
branches: [master, nextgen/**]
pull_request:
branches: master
workflow_dispatch:
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:

- name: Install seaborn
run: |
pip install --upgrade pip
pip install --upgrade pip wheel
if [[ ${{matrix.install}} == 'all' ]]; then EXTRAS='[all]'; fi
if [[ ${{matrix.deps }} == 'pinned' ]]; then DEPS='-r ci/deps_pinned.txt'; fi
pip install .$EXTRAS $DEPS -r ci/utils.txt
Expand All @@ -96,3 +96,24 @@ jobs:
- name: Upload coverage
uses: codecov/codecov-action@v2
if: ${{ success() }}

lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:

- name: Checkout
uses: actions/checkout@v2

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

- name: Install tools
run: pip install mypy flake8

- name: Flake8
run: make lint

- name: Type checking
run: make typecheck
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ htmlcov/
.idea/
.vscode/
.pytest_cache/
notes/
.DS_Store
notes/
notebooks/
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ unittests:

lint:
flake8 seaborn

typecheck:
mypy --follow-imports=skip seaborn/_core seaborn/_marks seaborn/_stats
13 changes: 8 additions & 5 deletions ci/deps_pinned.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
numpy~=1.16.0
pandas~=0.24.0
matplotlib~=3.0.0
scipy~=1.2.0
statsmodels~=0.9.0
numpy~=1.17.0
pandas~=0.25.0
matplotlib~=3.1.0
scipy~=1.3.0
statsmodels~=0.10.0
# Pillow added in install_requires for later matplotlibs
pillow>=6.2.0
typing_extensions
1 change: 1 addition & 0 deletions ci/utils.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ pytest!=5.3.4
pytest-cov
pytest-xdist
flake8
mypy
4 changes: 4 additions & 0 deletions doc/nextgen/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
_static/
api/
demo.rst
index.rst
25 changes: 25 additions & 0 deletions doc/nextgen/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

notebooks:
./nb_to_doc.py ./index.ipynb
./nb_to_doc.py ./demo.ipynb

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

77 changes: 77 additions & 0 deletions doc/nextgen/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
.. _nextgen_api:

.. currentmodule:: seaborn.objects

API Reference
=============

.. warning::

This is a provisional API that is under active development, incomplete, and subject to change before release.

Plot interface
--------------

.. autosummary::
:toctree: api/
:nosignatures:

Plot
Plot.add
Plot.scale
Plot.facet
Plot.pair
Plot.configure
Plot.on
Plot.plot
Plot.save
Plot.show

Marks
-----

.. autosummary::
:toctree: api/
:nosignatures:

Area
Bar
Dot
Line
Ribbon
Scatter

Stats
-----

.. autosummary::
:toctree: api/
:nosignatures:

Agg
Hist
PolyFit

Moves
-----

.. autosummary::
:toctree: api/
:nosignatures:

Dodge
Jitter
Shift
Stack


Scales
------

.. autosummary::
:toctree: api/
:nosignatures:

Nominal
Continuous
Temporal
88 changes: 88 additions & 0 deletions doc/nextgen/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

project = 'seaborn'
copyright = '2022, Michael Waskom'
author = 'Michael Waskom'

# The full version, including alpha/beta/rc tags
release = 'nextgen'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"numpydoc",
"IPython.sphinxext.ipython_console_highlighting",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.ipynb_checkpoints']

# The reST default role (used for this markup: `text`) to use for all documents.
default_role = 'literal'

autosummary_generate = True
numpydoc_show_class_members = False
autodoc_typehints = "none"

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "pydata_sphinx_theme"

html_theme_options = {
"show_prev_next": False,
"page_sidebar_items": [],
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

html_logo = "_static/logo.svg"

html_sidebars = {
# "**": [],
"demo": ["page-toc"]
}


# -- Intersphinx ------------------------------------------------

intersphinx_mapping = {
'numpy': ('https://numpy.org/doc/stable/', None),
'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None),
'matplotlib': ('https://matplotlib.org/stable', None),
'pandas': ('https://pandas.pydata.org/pandas-docs/stable/', None),
'statsmodels': ('https://www.statsmodels.org/stable/', None)
}
Loading

0 comments on commit 0550195

Please sign in to comment.