Skip to content

Commit eb3556a

Browse files
author
Ari Hartikainen
committed
run black
1 parent 17343fa commit eb3556a

10 files changed

+123
-119
lines changed

docs/conf.py

+73-55
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# -- General configuration ------------------------------------------------
2727

2828
# If your documentation needs a minimal Sphinx version, state it here.
29-
#needs_sphinx = '1.0'
29+
# needs_sphinx = '1.0'
3030

3131
# Add any Sphinx extension module names here, as strings. They can be
3232
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
@@ -47,6 +47,7 @@
4747
# pngmath / imgmath compatibility layer for different sphinx versions
4848
import sphinx
4949
from distutils.version import LooseVersion
50+
5051
if LooseVersion(sphinx.__version__) < LooseVersion('1.4'):
5152
extensions.append('sphinx.ext.pngmath')
5253
else:
@@ -64,7 +65,7 @@
6465
source_suffix = '.rst'
6566

6667
# The encoding of source files.
67-
#source_encoding = 'utf-8-sig'
68+
# source_encoding = 'utf-8-sig'
6869

6970
# Generate the plots for the gallery
7071
plot_gallery = True
@@ -82,38 +83,39 @@
8283
#
8384
# The short X.Y version.
8485
from cmdstanpy import __version__
86+
8587
version = __version__
8688
# The full version, including alpha/beta/rc tags.
8789
release = __version__
8890

8991
# The language for content autogenerated by Sphinx. Refer to documentation
9092
# for a list of supported languages.
91-
#language = None
93+
# language = None
9294

9395
# There are two options for replacing |today|: either, you set today to some
9496
# non-false value, then it is used:
95-
#today = ''
97+
# today = ''
9698
# Else, today_fmt is used as the format for a strftime call.
97-
#today_fmt = '%B %d, %Y'
99+
# today_fmt = '%B %d, %Y'
98100

99101
# List of patterns, relative to source directory, that match files and
100102
# directories to ignore when looking for source files.
101103
exclude_patterns = ['_build', '_templates']
102104

103105
# The reST default role (used for this markup: `text`) to use for all
104106
# documents.
105-
#default_role = None
107+
# default_role = None
106108

107109
# If true, '()' will be appended to :func: etc. cross-reference text.
108-
#add_function_parentheses = True
110+
# add_function_parentheses = True
109111

110112
# If true, the current module name will be prepended to all description
111113
# unit titles (such as .. function::).
112-
#add_module_names = True
114+
# add_module_names = True
113115

114116
# If true, sectionauthor and moduleauthor directives will be shown in the
115117
# output. They are ignored by default.
116-
#show_authors = False
118+
# show_authors = False
117119

118120
# The name of the Pygments (syntax highlighting) style to use.
119121
pygments_style = 'sphinx'
@@ -122,10 +124,10 @@
122124
html_style = 'css/project-template.css'
123125

124126
# A list of ignored prefixes for module index sorting.
125-
#modindex_common_prefix = []
127+
# modindex_common_prefix = []
126128

127129
# If true, keep warnings as "system message" paragraphs in the built documents.
128-
#keep_warnings = False
130+
# keep_warnings = False
129131

130132

131133
# -- Options for HTML output ----------------------------------------------
@@ -137,26 +139,26 @@
137139
# Theme options are theme-specific and customize the look and feel of a theme
138140
# further. For a list of options available for each theme, see the
139141
# documentation.
140-
#html_theme_options = {}
142+
# html_theme_options = {}
141143

142144
# Add any paths that contain custom themes here, relative to this directory.
143145
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
144146

145147
# The name for this set of Sphinx documents. If None, it defaults to
146148
# "<project> v<release> documentation".
147-
#html_title = None
149+
# html_title = None
148150

149151
# A shorter title for the navigation bar. Default is the same as html_title.
150-
#html_short_title = None
152+
# html_short_title = None
151153

152154
# The name of an image file (relative to this directory) to place at the top
153155
# of the sidebar.
154-
#html_logo = None
156+
# html_logo = None
155157

156158
# The name of an image file (within the static path) to use as favicon of the
157159
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
158160
# pixels large.
159-
#html_favicon = None
161+
# html_favicon = None
160162

161163
# Add any paths that contain custom static files (such as style sheets) here,
162164
# relative to this directory. They are copied after the builtin static files,
@@ -166,48 +168,48 @@
166168
# Add any extra paths that contain custom files (such as robots.txt or
167169
# .htaccess) here, relative to this directory. These files are copied
168170
# directly to the root of the documentation.
169-
#html_extra_path = []
171+
# html_extra_path = []
170172

171173
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
172174
# using the given strftime format.
173-
#html_last_updated_fmt = '%b %d, %Y'
175+
# html_last_updated_fmt = '%b %d, %Y'
174176

175177
# If true, SmartyPants will be used to convert quotes and dashes to
176178
# typographically correct entities.
177-
#html_use_smartypants = True
179+
# html_use_smartypants = True
178180

179181
# Custom sidebar templates, maps document names to template names.
180-
#html_sidebars = {}
182+
# html_sidebars = {}
181183

182184
# Additional templates that should be rendered to pages, maps page names to
183185
# template names.
184-
#html_additional_pages = {}
186+
# html_additional_pages = {}
185187

186188
# If false, no module index is generated.
187-
#html_domain_indices = True
189+
# html_domain_indices = True
188190

189191
# If false, no index is generated.
190-
#html_use_index = True
192+
# html_use_index = True
191193

192194
# If true, the index is split into individual pages for each letter.
193-
#html_split_index = False
195+
# html_split_index = False
194196

195197
# If true, links to the reST sources are added to the pages.
196-
#html_show_sourcelink = True
198+
# html_show_sourcelink = True
197199

198200
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
199-
#html_show_sphinx = True
201+
# html_show_sphinx = True
200202

201203
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
202-
#html_show_copyright = True
204+
# html_show_copyright = True
203205

204206
# If true, an OpenSearch description file will be output, and all pages will
205207
# contain a <link> tag referring to it. The value of this option must be the
206208
# base URL from which the finished HTML is served.
207-
#html_use_opensearch = ''
209+
# html_use_opensearch = ''
208210

209211
# This is the file name suffix for HTML files (e.g. ".xhtml").
210-
#html_file_suffix = None
212+
# html_file_suffix = None
211213

212214
# Output file base name for HTML help builder.
213215
htmlhelp_basename = 'project-templatedoc'
@@ -216,56 +218,64 @@
216218
# -- Options for LaTeX output ---------------------------------------------
217219

218220
latex_elements = {
219-
# The paper size ('letterpaper' or 'a4paper').
220-
#'papersize': 'letterpaper',
221-
222-
# The font size ('10pt', '11pt' or '12pt').
223-
#'pointsize': '10pt',
224-
225-
# Additional stuff for the LaTeX preamble.
226-
#'preamble': '',
221+
# The paper size ('letterpaper' or 'a4paper').
222+
#'papersize': 'letterpaper',
223+
# The font size ('10pt', '11pt' or '12pt').
224+
#'pointsize': '10pt',
225+
# Additional stuff for the LaTeX preamble.
226+
#'preamble': '',
227227
}
228228

229229
# Grouping the document tree into LaTeX files. List of tuples
230230
# (source start file, target name, title,
231231
# author, documentclass [howto, manual, or own class]).
232232
latex_documents = [
233-
('index', 'project-template.tex', u'project-template Documentation',
234-
u'Stan Development Team', 'manual'),
233+
(
234+
'index',
235+
'project-template.tex',
236+
u'project-template Documentation',
237+
u'Stan Development Team',
238+
'manual',
239+
),
235240
]
236241

237242
# The name of an image file (relative to this directory) to place at the top of
238243
# the title page.
239-
#latex_logo = None
244+
# latex_logo = None
240245

241246
# For "manual" documents, if this is true, then toplevel headings are parts,
242247
# not chapters.
243-
#latex_use_parts = False
248+
# latex_use_parts = False
244249

245250
# If true, show page references after internal links.
246-
#latex_show_pagerefs = False
251+
# latex_show_pagerefs = False
247252

248253
# If true, show URL addresses after external links.
249-
#latex_show_urls = False
254+
# latex_show_urls = False
250255

251256
# Documents to append as an appendix to all manuals.
252-
#latex_appendices = []
257+
# latex_appendices = []
253258

254259
# If false, no module index is generated.
255-
#latex_domain_indices = True
260+
# latex_domain_indices = True
256261

257262

258263
# -- Options for manual page output ---------------------------------------
259264

260265
# One entry per manual page. List of tuples
261266
# (source start file, name, description, authors, manual section).
262267
man_pages = [
263-
('index', 'project-template', u'project-template Documentation',
264-
[u'Stan Development Team'], 1)
268+
(
269+
'index',
270+
'project-template',
271+
u'project-template Documentation',
272+
[u'Stan Development Team'],
273+
1,
274+
)
265275
]
266276

267277
# If true, show URL addresses after external links.
268-
#man_show_urls = False
278+
# man_show_urls = False
269279

270280

271281
# -- Options for Texinfo output -------------------------------------------
@@ -274,21 +284,28 @@
274284
# (source start file, target name, title, author,
275285
# dir menu entry, description, category)
276286
texinfo_documents = [
277-
('index', 'project-template', u'project-template Documentation',
278-
u'Stan Development Team', 'project-template', '', ''),
287+
(
288+
'index',
289+
'project-template',
290+
u'project-template Documentation',
291+
u'Stan Development Team',
292+
'project-template',
293+
'',
294+
'',
295+
),
279296
]
280297

281298
# Documents to append as an appendix to all manuals.
282-
#texinfo_appendices = []
299+
# texinfo_appendices = []
283300

284301
# If false, no module index is generated.
285-
#texinfo_domain_indices = True
302+
# texinfo_domain_indices = True
286303

287304
# How to display URL addresses: 'footnote', 'no', or 'inline'.
288-
#texinfo_show_urls = 'footnote'
305+
# texinfo_show_urls = 'footnote'
289306

290307
# If true, do not generate a @detailmenu in the "Top" node's menu.
291-
#texinfo_no_detailmenu = False
308+
# texinfo_no_detailmenu = False
292309

293310

294311
# # Example configuration for intersphinx: refer to the Python standard library.
@@ -301,7 +318,7 @@
301318
# 'matplotlib': ('https://matplotlib.org/', None),
302319
# 'sklearn': ('http://scikit-learn.org/stable', None)
303320
# }
304-
#
321+
#
305322
# # sphinx-gallery configuration
306323
# sphinx_gallery_conf = {
307324
# 'doc_module': 'skltemplate',
@@ -310,6 +327,7 @@
310327
# 'skltemplate': None}
311328
# }
312329

330+
313331
def setup(app):
314332
# a copy button to copy snippet of code from the documentation
315333
app.add_javascript('js/copybutton.js')

test/example_script.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# explicit import to test if it is installed
88
# pylint: disable=E0401,W0611,C0411
9-
import tqdm # noqa
9+
import tqdm # noqa
1010

1111

1212
def run_bernoulli_fit():

test/test_cmdstan_args.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,8 @@ def test_adapt(self):
202202
)
203203

204204
args = SamplerArgs(
205-
adapt_init_phase=26,
206-
adapt_metric_window=60,
207-
adapt_step_size=34,
208-
)
205+
adapt_init_phase=26, adapt_metric_window=60, adapt_step_size=34,
206+
)
209207
args.validate(chains=4)
210208
cmd = args.compose(1, cmd=[])
211209
self.assertIn('method=sample algorithm=hmc adapt', ' '.join(cmd))

test/test_compiler_opts.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ def test_opts_empty(self):
1515
opts.validate()
1616
self.assertEqual(opts.compose(), [])
1717
self.assertEqual(
18-
opts.__repr__(),
19-
'stanc_options=None, cpp_options=None',
18+
opts.__repr__(), 'stanc_options=None, cpp_options=None',
2019
)
2120

2221
stanc_opts = {}
@@ -32,9 +31,7 @@ def test_opts_empty(self):
3231
opts = CompilerOptions(stanc_options=stanc_opts, cpp_options=cpp_opts)
3332
opts.validate()
3433
self.assertEqual(opts.compose(), [])
35-
self.assertEqual(
36-
opts.__repr__(), 'stanc_options={}, cpp_options={}'
37-
)
34+
self.assertEqual(opts.__repr__(), 'stanc_options={}, cpp_options={}')
3835

3936
def test_opts_stanc(self):
4037
stanc_opts = {}

0 commit comments

Comments
 (0)