Skip to content

Commit 9e4d257

Browse files
committed
MNT: apply black again
1 parent c4ded48 commit 9e4d257

File tree

3 files changed

+83
-83
lines changed

3 files changed

+83
-83
lines changed

docs/source/conf.py

Lines changed: 66 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@
1818
# documentation root, use os.path.abspath to make it absolute, like shown here.
1919
#
2020
import os
21+
2122
# import sys
2223
# sys.path.insert(0, os.path.abspath('.'))
2324
from pathlib import Path
2425

2526
# are we running circle CI?
26-
CIRCLECI = 'CIRCLECI' in os.environ
27+
CIRCLECI = "CIRCLECI" in os.environ
2728

2829
# -- General configuration ------------------------------------------------
2930

@@ -35,18 +36,18 @@
3536
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3637
# ones.
3738
extensions = [
38-
'sphinx.ext.autodoc',
39-
'sphinx.ext.autosummary',
40-
'sphinx.ext.githubpages',
41-
'sphinx.ext.intersphinx',
42-
'sphinx.ext.mathjax',
43-
'sphinx.ext.viewcode',
44-
'IPython.sphinxext.ipython_directive',
45-
'IPython.sphinxext.ipython_console_highlighting',
46-
'matplotlib.sphinxext.plot_directive',
47-
'numpydoc',
48-
'sphinx_copybutton',
49-
'sphinx_gallery.gen_gallery',
39+
"sphinx.ext.autodoc",
40+
"sphinx.ext.autosummary",
41+
"sphinx.ext.githubpages",
42+
"sphinx.ext.intersphinx",
43+
"sphinx.ext.mathjax",
44+
"sphinx.ext.viewcode",
45+
"IPython.sphinxext.ipython_directive",
46+
"IPython.sphinxext.ipython_console_highlighting",
47+
"matplotlib.sphinxext.plot_directive",
48+
"numpydoc",
49+
"sphinx_copybutton",
50+
"sphinx_gallery.gen_gallery",
5051
]
5152

5253
# Configuration options for plot_directive. See:
@@ -63,8 +64,8 @@
6364

6465
# Sphinx gallery configuration
6566

66-
def matplotlib_reduced_latex_scraper(block, block_vars, gallery_conf,
67-
**kwargs):
67+
68+
def matplotlib_reduced_latex_scraper(block, block_vars, gallery_conf, **kwargs):
6869
"""
6970
Reduce srcset when creating a PDF.
7071
@@ -73,56 +74,59 @@ def matplotlib_reduced_latex_scraper(block, block_vars, gallery_conf,
7374
"""
7475
from sphinx_gallery.scrapers import matplotlib_scraper
7576

76-
if gallery_conf['builder_name'] == 'latex':
77-
gallery_conf['image_srcset'] = []
77+
if gallery_conf["builder_name"] == "latex":
78+
gallery_conf["image_srcset"] = []
7879
return matplotlib_scraper(block, block_vars, gallery_conf, **kwargs)
7980

8081

8182
sphinx_gallery_conf = {
82-
'examples_dirs': ['../../examples', ],
83-
'filename_pattern': '^((?!sgskip).)*$',
84-
'gallery_dirs': ['gallery'],
85-
'doc_module': ('data_prototype',),
86-
'reference_url': {
87-
'matplotlib': None,
83+
"examples_dirs": [
84+
"../../examples",
85+
],
86+
"filename_pattern": "^((?!sgskip).)*$",
87+
"gallery_dirs": ["gallery"],
88+
"doc_module": ("data_prototype",),
89+
"reference_url": {
90+
"matplotlib": None,
8891
},
89-
'backreferences_dir': Path('api') / Path('_as_gen'),
90-
'remove_config_comments': True,
91-
'min_reported_time': 1,
92-
'thumbnail_size': (320, 224),
93-
'image_scrapers': (matplotlib_reduced_latex_scraper, ),
92+
"backreferences_dir": Path("api") / Path("_as_gen"),
93+
"remove_config_comments": True,
94+
"min_reported_time": 1,
95+
"thumbnail_size": (320, 224),
96+
"image_scrapers": (matplotlib_reduced_latex_scraper,),
9497
# Compression is a significant effort that we skip for local and CI builds.
95-
'compress_images': ('thumbnails', 'images') if is_release_build else (),
96-
'matplotlib_animations': True,
97-
'image_srcset': ["2x"],
98-
'junit': '../test-results/sphinx-gallery/junit.xml' if CIRCLECI else '',
98+
"compress_images": ("thumbnails", "images") if is_release_build else (),
99+
"matplotlib_animations": True,
100+
"image_srcset": ["2x"],
101+
"junit": "../test-results/sphinx-gallery/junit.xml" if CIRCLECI else "",
99102
}
100103

101104
mathmpl_fontsize = 11.0
102-
mathmpl_srcset = ['2x']
105+
mathmpl_srcset = ["2x"]
103106

104107
# Add any paths that contain templates here, relative to this directory.
105-
templates_path = ['_templates']
108+
templates_path = ["_templates"]
106109

107110
# The suffix(es) of source filenames.
108111
# You can specify multiple suffix as a list of string:
109112
#
110113
# source_suffix = ['.rst', '.md']
111-
source_suffix = '.rst'
114+
source_suffix = ".rst"
112115

113116
# The master toctree document.
114-
master_doc = 'index'
117+
master_doc = "index"
115118

116119
# General information about the project.
117-
project = 'data_prototype'
118-
copyright = '2022, Thomas A Caswell'
119-
author = 'Thomas A Caswell'
120+
project = "data_prototype"
121+
copyright = "2022, Thomas A Caswell"
122+
author = "Thomas A Caswell"
120123

121124
# The version info for the project you're documenting, acts as replacement for
122125
# |version| and |release|, also used in various other places throughout the
123126
# built documents.
124127
#
125128
import data_prototype
129+
126130
# The short X.Y version.
127131
version = data_prototype.__version__
128132
# The full version, including alpha/beta/rc tags.
@@ -141,7 +145,7 @@ def matplotlib_reduced_latex_scraper(block, block_vars, gallery_conf,
141145
exclude_patterns = []
142146

143147
# The name of the Pygments (syntax highlighting) style to use.
144-
pygments_style = 'sphinx'
148+
pygments_style = "sphinx"
145149

146150
# If true, `todo` and `todoList` produce output, else they produce nothing.
147151
todo_include_todos = False
@@ -160,32 +164,30 @@ def matplotlib_reduced_latex_scraper(block, block_vars, gallery_conf,
160164
# documentation.
161165
#
162166

163-
html_theme_options = {
164-
"logo": {}
165-
}
167+
html_theme_options = {"logo": {}}
166168

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

172174
# Custom sidebar templates, must be a dictionary that maps document names
173175
# to template names.
174176
#
175177
# This is required for the alabaster theme
176178
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
177179
html_sidebars = {
178-
'**': [
179-
'relations.html', # needs 'show_related': True theme option to display
180-
'searchbox.html',
180+
"**": [
181+
"relations.html", # needs 'show_related': True theme option to display
182+
"searchbox.html",
181183
]
182184
}
183185

184186

185187
# -- Options for HTMLHelp output ------------------------------------------
186188

187189
# Output file base name for HTML help builder.
188-
htmlhelp_basename = 'data_prototype'
190+
htmlhelp_basename = "data_prototype"
189191

190192

191193
# -- Options for LaTeX output ---------------------------------------------
@@ -194,15 +196,12 @@ def matplotlib_reduced_latex_scraper(block, block_vars, gallery_conf,
194196
# The paper size ('letterpaper' or 'a4paper').
195197
#
196198
# 'papersize': 'letterpaper',
197-
198199
# The font size ('10pt', '11pt' or '12pt').
199200
#
200201
# 'pointsize': '10pt',
201-
202202
# Additional stuff for the LaTeX preamble.
203203
#
204204
# 'preamble': '',
205-
206205
# Latex figure (float) alignment
207206
#
208207
# 'figure_align': 'htbp',
@@ -212,19 +211,15 @@ def matplotlib_reduced_latex_scraper(block, block_vars, gallery_conf,
212211
# (source start file, target name, title,
213212
# author, documentclass [howto, manual, or own class]).
214213
latex_documents = [
215-
(master_doc, 'data_prototype.tex', 'data_prototype Documentation',
216-
'Contributors', 'manual'),
214+
(master_doc, "data_prototype.tex", "data_prototype Documentation", "Contributors", "manual"),
217215
]
218216

219217

220218
# -- Options for manual page output ---------------------------------------
221219

222220
# One entry per manual page. List of tuples
223221
# (source start file, name, description, authors, manual section).
224-
man_pages = [
225-
(master_doc, 'data_prototype', 'data_prototype Documentation',
226-
[author], 1)
227-
]
222+
man_pages = [(master_doc, "data_prototype", "data_prototype Documentation", [author], 1)]
228223

229224

230225
# -- Options for Texinfo output -------------------------------------------
@@ -233,19 +228,23 @@ def matplotlib_reduced_latex_scraper(block, block_vars, gallery_conf,
233228
# (source start file, target name, title, author,
234229
# dir menu entry, description, category)
235230
texinfo_documents = [
236-
(master_doc, 'data_prototype', 'data_prototype Documentation',
237-
author, 'data_prototype', 'Experimental code for the upcoming Matplotlib data refactor.',
238-
'Miscellaneous'),
231+
(
232+
master_doc,
233+
"data_prototype",
234+
"data_prototype Documentation",
235+
author,
236+
"data_prototype",
237+
"Experimental code for the upcoming Matplotlib data refactor.",
238+
"Miscellaneous",
239+
),
239240
]
240241

241242

242-
243-
244243
# Example configuration for intersphinx: refer to the Python standard library.
245244
intersphinx_mapping = {
246-
'python': ('https://docs.python.org/3/', None),
247-
'numpy': ('https://numpy.org/doc/stable/', None),
248-
'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None),
249-
'pandas': ('https://pandas.pydata.org/pandas-docs/stable', None),
250-
'matplotlib': ('https://matplotlib.org/stable', None),
245+
"python": ("https://docs.python.org/3/", None),
246+
"numpy": ("https://numpy.org/doc/stable/", None),
247+
"scipy": ("https://docs.scipy.org/doc/scipy/reference/", None),
248+
"pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
249+
"matplotlib": ("https://matplotlib.org/stable", None),
251250
}

examples/first.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from data_prototype.wrappers import LineWrapper
1414
from data_prototype.containers import FuncContainer, SeriesContainer
1515

16-
fc = FuncContainer({"x": (("N", ), lambda x: x), "y": (("N", ), np.sin)})
16+
fc = FuncContainer({"x": (("N",), lambda x: x), "y": (("N",), np.sin)})
1717
lw = LineWrapper(fc, lw=5, color="green", label="sin (function)")
1818

1919
th = np.linspace(0, 2 * np.pi, 16)

setup.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,32 @@
1818
Upgrade pip like so:
1919
2020
pip install --upgrade pip
21-
""".format(*(sys.version_info[:2] + min_version))
21+
""".format(
22+
*(sys.version_info[:2] + min_version)
23+
)
2224
sys.exit(error)
2325

2426
here = path.abspath(path.dirname(__file__))
2527

26-
with open(path.join(here, 'README.rst'), encoding='utf-8') as readme_file:
28+
with open(path.join(here, "README.rst"), encoding="utf-8") as readme_file:
2729
readme = readme_file.read()
2830

29-
with open(path.join(here, 'requirements.txt')) as requirements_file:
31+
with open(path.join(here, "requirements.txt")) as requirements_file:
3032
# Parse requirements.txt, ignoring any commented-out lines.
31-
requirements = [line for line in requirements_file.read().splitlines()
32-
if not line.startswith('#')]
33+
requirements = [line for line in requirements_file.read().splitlines() if not line.startswith("#")]
3334

3435

3536
setup(
36-
name='data_prototype',
37+
name="data_prototype",
3738
description="Experimental code for the upcoming Matplotlib data refactor.",
3839
long_description=readme,
3940
author="Thomas A Caswell",
40-
author_email='tcaswell@gmail.com',
41-
url='https://github.com/tacaswell/data_prototype',
42-
python_requires='>={}'.format('.'.join(str(n) for n in min_version)),
43-
packages=find_packages(exclude=['docs', 'tests']),
41+
author_email="tcaswell@gmail.com",
42+
url="https://github.com/tacaswell/data_prototype",
43+
python_requires=">={}".format(".".join(str(n) for n in min_version)),
44+
packages=find_packages(exclude=["docs", "tests"]),
4445
entry_points={
45-
'console_scripts': [
46+
"console_scripts": [
4647
# 'command = some.module:some_function',
4748
],
4849
},
@@ -59,7 +60,7 @@
5960
},
6061
include_package_data=True,
6162
package_data={
62-
'data_prototype': [
63+
"data_prototype": [
6364
# When adding files here, remember to update MANIFEST.in as well,
6465
# or else they will not be included in the distribution on PyPI!
6566
# 'path/to/data_file',
@@ -68,8 +69,8 @@
6869
install_requires=requirements,
6970
license="BSD (3-clause)",
7071
classifiers=[
71-
'Development Status :: 2 - Pre-Alpha',
72-
'Natural Language :: English',
73-
'Programming Language :: Python :: 3',
72+
"Development Status :: 2 - Pre-Alpha",
73+
"Natural Language :: English",
74+
"Programming Language :: Python :: 3",
7475
],
7576
)

0 commit comments

Comments
 (0)