Skip to content

Commit da5104f

Browse files
trallarddrammock
authored andcommitted
automatic changes from b633898 and 9c5a3d5
1 parent 2dc4fcb commit da5104f

File tree

36 files changed

+214
-108
lines changed

36 files changed

+214
-108
lines changed

.git-blame-ignore-revs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
# https://git-scm.com/docs/git-config#Documentation/git-config.txt-blameignoreRevsFile
66
# https://github.com/pydata/pydata-sphinx-theme/pull/713
77
#
8-
90550b66ace16a370caa446e54698b126fda740b # initial black-format
9-
236d4c6d1f10f5da064d929e9eb594daecf23551 # apply black 20.8b1 format
10-
69f1a42a3b184f4ba4c98f1745779a277d56c5e2 # [pre-commit.ci] Automatic linting and formatting fixes
11-
a35529c9ee8d5863613df40787cda0021b3e0128 # Manual fixes for stylelint
12-
ce583b8f3136d52e8056c9a651bf6f92e7922f79 # Manual adjustments to autofixes
13-
d1ee9eb7a132cde51433e9594513319fdab41f2f # Autofix (stylelint)
8+
90550b66ace16a370caa446e54698b126fda740b # initial black-format
9+
236d4c6d1f10f5da064d929e9eb594daecf23551 # apply black 20.8b1 format
10+
69f1a42a3b184f4ba4c98f1745779a277d56c5e2 # [pre-commit.ci] Automatic linting and formatting fixes
11+
a35529c9ee8d5863613df40787cda0021b3e0128 # Manual fixes for stylelint
12+
ce583b8f3136d52e8056c9a651bf6f92e7922f79 # Manual adjustments to autofixes
13+
d1ee9eb7a132cde51433e9594513319fdab41f2f # Autofix (stylelint)

docs/_extension/component_directive.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"""
77

88
import re
9+
910
from pathlib import Path
1011
from typing import Any, Dict, List
1112

@@ -14,6 +15,7 @@
1415
from sphinx.util import logging
1516
from sphinx.util.docutils import SphinxDirective
1617

18+
1719
logger = logging.getLogger(__name__)
1820

1921

docs/_extension/gallery_directive.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from sphinx.util.docutils import SphinxDirective
2020
from yaml import safe_load
2121

22+
2223
logger = logging.getLogger(__name__)
2324

2425

@@ -76,7 +77,7 @@ def run(self) -> List[nodes.Node]:
7677
path_doc = Path(path_doc).parent
7778
path_data = (path_doc / path_data_rel).resolve()
7879
if not path_data.exists():
79-
logger.info(f"Could not find grid data at {path_data}.")
80+
logger.info("Could not find grid data at %s.", path_data)
8081
nodes.text("No grid data found at {path_data}.")
8182
return
8283
yaml_string = path_data.read_text()

docs/conf.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# -- Path setup --------------------------------------------------------------
99
import os
1010
import sys
11+
1112
from pathlib import Path
1213
from typing import Any, Dict
1314

@@ -16,6 +17,7 @@
1617

1718
import pydata_sphinx_theme
1819

20+
1921
sys.path.append(str(Path(".").resolve()))
2022

2123
# -- Project information -----------------------------------------------------
@@ -192,7 +194,8 @@
192194
},
193195
"use_edit_page_button": True,
194196
"show_toc_level": 1,
195-
"navbar_align": "left", # [left, content, right] For testing that the navbar items align properly
197+
# [left, content, right] For testing that the navbar items align properly
198+
"navbar_align": "left",
196199
# "show_nav_level": 2,
197200
"announcement": "https://raw.githubusercontent.com/pydata/pydata-sphinx-theme/main/docs/_templates/custom-template.html",
198201
"show_version_warning_banner": True,
@@ -294,10 +297,15 @@
294297
def setup_to_main(
295298
app: Sphinx, pagename: str, templatename: str, context, doctree
296299
) -> None:
297-
"""Add a function that jinja can access for returning an "edit this page" link pointing to `main`."""
300+
"""
301+
Add a function that jinja can access for returning an "edit this page" link
302+
pointing to `main`.
303+
"""
298304

299305
def to_main(link: str) -> str:
300-
"""Transform "edit on github" links and make sure they always point to the main branch.
306+
"""
307+
Transform "edit on github" links and make sure they always point to the
308+
main branch.
301309
302310
Args:
303311
link: the link to the github edit interface

docs/examples/pydata.ipynb

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"import numpy as np\n",
3030
"import pandas as pd\n",
3131
"\n",
32+
"\n",
3233
"rng = np.random.default_rng(seed=15485863)\n",
3334
"data = rng.standard_normal((100, 26))\n",
3435
"df = pd.DataFrame(data, columns=list(string.ascii_lowercase))\n",
@@ -51,8 +52,10 @@
5152
"import ipywidgets as widgets\n",
5253
"import numpy as np\n",
5354
"import pandas as pd\n",
55+
"\n",
5456
"from IPython.display import display\n",
5557
"\n",
58+
"\n",
5659
"tab = widgets.Tab()\n",
5760
"\n",
5861
"descr_str = \"Hello\"\n",
@@ -65,9 +68,9 @@
6568
"\n",
6669
"# render in output widgets\n",
6770
"with widget_images:\n",
68-
" display(pd.DataFrame(np.random.randn(10,10)))\n",
71+
" display(pd.DataFrame(np.random.randn(10, 10)))\n",
6972
"with widget_annotations:\n",
70-
" display(pd.DataFrame(np.random.randn(10,10)))\n",
73+
" display(pd.DataFrame(np.random.randn(10, 10)))\n",
7174
"\n",
7275
"tab.children = [widget_images, widget_annotations]\n",
7376
"tab.titles = [\"Images\", \"Annotations\"]\n",
@@ -90,6 +93,7 @@
9093
"source": [
9194
"import matplotlib.pyplot as plt\n",
9295
"\n",
96+
"\n",
9397
"fig, ax = plt.subplots()\n",
9498
"ax.scatter(df[\"a\"], df[\"b\"], c=df[\"b\"], s=3)"
9599
]
@@ -125,10 +129,13 @@
125129
"import plotly.express as px\n",
126130
"import plotly.io as pio\n",
127131
"\n",
132+
"\n",
128133
"pio.renderers.default = \"notebook\"\n",
129134
"\n",
130135
"df = px.data.iris()\n",
131-
"fig = px.scatter(df, x=\"sepal_width\", y=\"sepal_length\", color=\"species\", size=\"sepal_length\")\n",
136+
"fig = px.scatter(\n",
137+
" df, x=\"sepal_width\", y=\"sepal_length\", color=\"species\", size=\"sepal_length\"\n",
138+
")\n",
132139
"fig"
133140
]
134141
},
@@ -149,11 +156,10 @@
149156
"source": [
150157
"import xarray as xr\n",
151158
"\n",
159+
"\n",
152160
"data = xr.DataArray(\n",
153-
" np.random.randn(2, 3),\n",
154-
" dims=(\"x\", \"y\"),\n",
155-
" coords={\"x\": [10, 20]}, attrs={\"foo\": \"bar\"}\n",
156-
" )\n",
161+
" np.random.randn(2, 3), dims=(\"x\", \"y\"), coords={\"x\": [10, 20]}, attrs={\"foo\": \"bar\"}\n",
162+
")\n",
157163
"data"
158164
]
159165
},
@@ -174,8 +180,9 @@
174180
"source": [
175181
"from ipyleaflet import Map, basemaps\n",
176182
"\n",
183+
"\n",
177184
"# display a map centered on France\n",
178-
"m = Map(basemap=basemaps.Esri.WorldImagery, zoom=5, center=[46.21, 2.21])\n",
185+
"m = Map(basemap=basemaps.Esri.WorldImagery, zoom=5, center=[46.21, 2.21])\n",
179186
"m"
180187
]
181188
}

docs/scripts/generate_collaborators_gallery.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
"""Uses the GitHub API to list a gallery of all people with direct access to the repository."""
1+
"""
2+
Uses the GitHub API to list a gallery of all people with direct access to the
3+
repository.
4+
"""
25

36
import json
47
import shlex
8+
59
from pathlib import Path
610
from subprocess import run
711

812
from yaml import dump
913

14+
1015
COLLABORATORS_API = "https://api.github.com/repos/pydata/pydata-sphinx-theme/collaborators?affiliation=direct"
1116

1217
print("Grabbing latest collaborators with GitHub API via GitHub's CLI...")

docs/scripts/update_kitchen_sink.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
from pathlib import Path
44
from urllib.request import urlopen
55

6+
67
EXTRA_MESSAGE = """\
78
.. note::
89
9-
The Kitchen Sink was generated from the `Sphinx Themes website <https://sphinx-themes.org/>`_, a community-supported showcase of themes for `Sphinx <https://www.sphinx-doc.org/>`_.
10+
The Kitchen Sink was generated from the
11+
`Sphinx Themes website <https://sphinx-themes.org/>`_, a community-supported showcase
12+
of themes for `Sphinx <https://www.sphinx-doc.org/>`_.
1013
Check it out to see other great themes.
1114
1215
.. button-link:: https://sphinx-themes.org

docs/user_guide/layout.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,4 +593,3 @@ Please find here the full list of keys you can use in the ``html_theme_options``
593593
.. include:: ../../src/pydata_sphinx_theme/theme/pydata_sphinx_theme/theme.conf
594594
:code: ini
595595
:class: highlight-ini
596-

src/pydata_sphinx_theme/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
"""Bootstrap-based sphinx theme from the PyData community."""
22

33
import json
4+
45
from functools import partial
56
from pathlib import Path
67
from typing import Dict
78
from urllib.parse import urlparse
89

910
import requests
11+
1012
from requests.exceptions import ConnectionError, HTTPError, RetryError
1113
from sphinx.application import Sphinx
1214
from sphinx.builders.dirhtml import DirectoryHTMLBuilder
1315
from sphinx.errors import ExtensionError
1416

1517
from . import edit_this_page, logo, pygments, short_link, toctree, translator, utils
1618

19+
1720
__version__ = "0.16.1dev0"
1821

1922

@@ -202,7 +205,7 @@ def update_and_remove_templates(
202205
for i in range(len(context["css_files"])):
203206
asset = context["css_files"][i]
204207
# TODO: eventually the contents of context['css_files'] etc should probably
205-
# only be _CascadingStyleSheet etc. For now, assume mixed with strings.
208+
# only be _CascadingStyleSheet etc. For now, assume mixed with strings.
206209
asset_path = getattr(asset, "filename", str(asset))
207210
if asset_path == theme_css_name:
208211
del context["css_files"][i]
@@ -233,7 +236,8 @@ def update_and_remove_templates(
233236
DOCUMENTATION_OPTIONS.theme_version = '{__version__}';
234237
DOCUMENTATION_OPTIONS.theme_switcher_json_url = '{json_url}';
235238
DOCUMENTATION_OPTIONS.theme_switcher_version_match = '{version_match}';
236-
DOCUMENTATION_OPTIONS.show_version_warning_banner = {str(context["theme_show_version_warning_banner"]).lower()};
239+
DOCUMENTATION_OPTIONS.show_version_warning_banner =
240+
{str(context["theme_show_version_warning_banner"]).lower()};
237241
"""
238242
app.add_js_file(None, body=js)
239243

src/pydata_sphinx_theme/edit_this_page.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Create an "edit this page" url compatible with bitbucket, gitlab and github."""
22

33
import jinja2
4+
45
from sphinx.application import Sphinx
56
from sphinx.errors import ExtensionError
67

0 commit comments

Comments
 (0)