Skip to content

Commit 08948d7

Browse files
authored
Apply formatting and flake8 fixes (#100)
* applied black formatting * added flake8 configuration file * made repo flake8-compliant * renamed numpy to np * incremented version
1 parent 70c946b commit 08948d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+4853
-4620
lines changed

.flake8

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[flake8]
2+
ignore = E203, E266, E501, W503, E302
3+
max-line-length = 120
4+
select = B,C,E,F,W,T4,B9
5+
exclude =
6+
# No need to traverse the git directory
7+
.git,
8+
# There's no value in checking cache directories
9+
__pycache__,
10+
# The conf file is mostly autogenerated, ignore it
11+
doc/conf.py,
12+
# No need for init and setup files
13+
*__init__.py
14+
*setup.py
15+
# OptView and related files need to be fixed eventually
16+
postprocessing/OptView.py
17+
postprocessing/OptView_baseclass.py

doc/conf.py

Lines changed: 75 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -16,76 +16,82 @@
1616
# If extensions (or modules to document with autodoc) are in another directory,
1717
# add these directories to sys.path here. If the directory is relative to the
1818
# documentation root, use os.path.abspath to make it absolute, like shown here.
19-
sys.path.insert(0, os.path.abspath('../'))
19+
sys.path.insert(0, os.path.abspath("../"))
2020

2121
# -- General configuration -----------------------------------------------------
2222

2323
# If your documentation needs a minimal Sphinx version, state it here.
24-
#needs_sphinx = '1.0'
24+
# needs_sphinx = '1.0'
2525

2626
# Add any Sphinx extension module names here, as strings. They can be extensions
2727
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
28-
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.viewcode', 'numpydoc','sphinx.ext.autosummary']
28+
extensions = [
29+
"sphinx.ext.autodoc",
30+
"sphinx.ext.intersphinx",
31+
"sphinx.ext.viewcode",
32+
"numpydoc",
33+
"sphinx.ext.autosummary",
34+
]
2935
numpydoc_show_class_members = False
3036

3137
# Add any paths that contain templates here, relative to this directory.
32-
templates_path = ['_templates']
38+
templates_path = ["_templates"]
3339

3440
# The suffix of source filenames.
35-
source_suffix = '.rst'
41+
source_suffix = ".rst"
3642

3743
# The encoding of source files.
38-
#source_encoding = 'utf-8-sig'
44+
# source_encoding = 'utf-8-sig'
3945

4046
# The master toctree document.
41-
master_doc = 'index'
47+
master_doc = "index"
4248

4349
# General information about the project.
44-
project = u'pyOptSparse'
45-
copyright = u'2013, Gaetan Kenway'
50+
project = u"pyOptSparse"
51+
copyright = u"2013, Gaetan Kenway"
4652

4753
# The version info for the project you're documenting, acts as replacement for
4854
# |version| and |release|, also used in various other places throughout the
4955
# built documents.
5056
#
5157
# The short X.Y version.
52-
version = 'dev'
58+
version = "dev"
5359
# The full version, including alpha/beta/rc tags.
54-
release = 'dev'
60+
release = "dev"
5561

5662
# The language for content autogenerated by Sphinx. Refer to documentation
5763
# for a list of supported languages.
58-
#language = None
64+
# language = None
5965

6066
# There are two options for replacing |today|: either, you set today to some
6167
# non-false value, then it is used:
62-
#today = ''
68+
# today = ''
6369
# Else, today_fmt is used as the format for a strftime call.
64-
#today_fmt = '%B %d, %Y'
70+
# today_fmt = '%B %d, %Y'
6571

6672
# List of patterns, relative to source directory, that match files and
6773
# directories to ignore when looking for source files.
68-
exclude_patterns = ['_build']
74+
exclude_patterns = ["_build"]
6975

7076
# The reST default role (used for this markup: `text`) to use for all documents.
71-
#default_role = None
77+
# default_role = None
7278

7379
# If true, '()' will be appended to :func: etc. cross-reference text.
74-
#add_function_parentheses = True
80+
# add_function_parentheses = True
7581

7682
# If true, the current module name will be prepended to all description
7783
# unit titles (such as .. function::).
78-
#add_module_names = True
84+
# add_module_names = True
7985

8086
# If true, sectionauthor and moduleauthor directives will be shown in the
8187
# output. They are ignored by default.
82-
#show_authors = False
88+
# show_authors = False
8389

8490
# The name of the Pygments (syntax highlighting) style to use.
85-
pygments_style = 'sphinx'
91+
pygments_style = "sphinx"
8692

8793
# A list of ignored prefixes for module index sorting.
88-
#modindex_common_prefix = []
94+
# modindex_common_prefix = []
8995

9096

9197
# -- Options for HTML output ---------------------------------------------------
@@ -100,129 +106,123 @@
100106
# Theme options are theme-specific and customize the look and feel of a theme
101107
# further. For a list of options available for each theme, see the
102108
# documentation.
103-
#html_theme_options = {}
109+
# html_theme_options = {}
104110

105111
# Add any paths that contain custom themes here, relative to this directory.
106-
#html_theme_path = []
112+
# html_theme_path = []
107113

108114
# The name for this set of Sphinx documents. If None, it defaults to
109115
# "<project> v<release> documentation".
110-
#html_title = None
116+
# html_title = None
111117

112118
# A shorter title for the navigation bar. Default is the same as html_title.
113-
#html_short_title = None
119+
# html_short_title = None
114120

115121
# The name of an image file (relative to this directory) to place at the top
116122
# of the sidebar.
117-
#html_logo = None
123+
# html_logo = None
118124

119125
# The name of an image file (within the static path) to use as favicon of the
120126
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
121127
# pixels large.
122-
#html_favicon = None
128+
# html_favicon = None
123129

124130
# Add any paths that contain custom static files (such as style sheets) here,
125131
# relative to this directory. They are copied after the builtin static files,
126132
# so a file named "default.css" will overwrite the builtin "default.css".
127-
html_static_path = ['themes/mdolab_theme/static']
133+
html_static_path = ["themes/mdolab_theme/static"]
128134

129135
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
130136
# using the given strftime format.
131-
#html_last_updated_fmt = '%b %d, %Y'
137+
# html_last_updated_fmt = '%b %d, %Y'
132138

133139
# If true, SmartyPants will be used to convert quotes and dashes to
134140
# typographically correct entities.
135-
#html_use_smartypants = True
141+
# html_use_smartypants = True
136142

137143
# Custom sidebar templates, maps document names to template names.
138-
#html_sidebars = {}
144+
# html_sidebars = {}
139145

140146
# Additional templates that should be rendered to pages, maps page names to
141147
# template names.
142-
#html_additional_pages = {}
148+
# html_additional_pages = {}
143149

144150
# If false, no module index is generated.
145-
#html_domain_indices = True
151+
# html_domain_indices = True
146152

147153
# If false, no index is generated.
148-
#html_use_index = True
154+
# html_use_index = True
149155

150156
# If true, the index is split into individual pages for each letter.
151-
#html_split_index = False
157+
# html_split_index = False
152158

153159
# If true, links to the reST sources are added to the pages.
154-
#html_show_sourcelink = True
160+
# html_show_sourcelink = True
155161

156162
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
157-
#html_show_sphinx = True
163+
# html_show_sphinx = True
158164

159165
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
160-
#html_show_copyright = True
166+
# html_show_copyright = True
161167

162168
# If true, an OpenSearch description file will be output, and all pages will
163169
# contain a <link> tag referring to it. The value of this option must be the
164170
# base URL from which the finished HTML is served.
165-
#html_use_opensearch = ''
171+
# html_use_opensearch = ''
166172

167173
# This is the file name suffix for HTML files (e.g. ".xhtml").
168-
#html_file_suffix = None
174+
# html_file_suffix = None
169175

170176
# Output file base name for HTML help builder.
171-
htmlhelp_basename = 'pyOptSparsedoc'
177+
htmlhelp_basename = "pyOptSparsedoc"
172178

173179

174180
# -- Options for LaTeX output --------------------------------------------------
175181

176182
latex_elements = {
177-
# The paper size ('letterpaper' or 'a4paper').
178-
#'papersize': 'letterpaper',
179-
180-
# The font size ('10pt', '11pt' or '12pt').
181-
#'pointsize': '10pt',
182-
183-
# Additional stuff for the LaTeX preamble.
184-
#'preamble': '',
183+
# The paper size ('letterpaper' or 'a4paper').
184+
#'papersize': 'letterpaper',
185+
# The font size ('10pt', '11pt' or '12pt').
186+
#'pointsize': '10pt',
187+
# Additional stuff for the LaTeX preamble.
188+
#'preamble': '',
185189
}
186190

187191
# Grouping the document tree into LaTeX files. List of tuples
188192
# (source start file, target name, title, author, documentclass [howto/manual]).
189193
latex_documents = [
190-
('index', 'pyOptSparse.tex', u'pyOptSparse Documentation',
191-
u'Gaetan Kenway', 'manual'),
194+
("index", "pyOptSparse.tex", u"pyOptSparse Documentation", u"Gaetan Kenway", "manual"),
192195
]
193196

194197
# The name of an image file (relative to this directory) to place at the top of
195198
# the title page.
196-
#latex_logo = None
199+
# latex_logo = None
197200

198201
# For "manual" documents, if this is true, then toplevel headings are parts,
199202
# not chapters.
200-
#latex_use_parts = False
203+
# latex_use_parts = False
201204

202205
# If true, show page references after internal links.
203-
#latex_show_pagerefs = False
206+
# latex_show_pagerefs = False
204207

205208
# If true, show URL addresses after external links.
206-
#latex_show_urls = False
209+
# latex_show_urls = False
207210

208211
# Documents to append as an appendix to all manuals.
209-
#latex_appendices = []
212+
# latex_appendices = []
210213

211214
# If false, no module index is generated.
212-
#latex_domain_indices = True
215+
# latex_domain_indices = True
213216

214217

215218
# -- Options for manual page output --------------------------------------------
216219

217220
# One entry per manual page. List of tuples
218221
# (source start file, name, description, authors, manual section).
219-
man_pages = [
220-
('index', 'pyoptsparse', u'pyOptSparse Documentation',
221-
[u'Gaetan Kenway'], 1)
222-
]
222+
man_pages = [("index", "pyoptsparse", u"pyOptSparse Documentation", [u"Gaetan Kenway"], 1)]
223223

224224
# If true, show URL addresses after external links.
225-
#man_show_urls = False
225+
# man_show_urls = False
226226

227227

228228
# -- Options for Texinfo output ------------------------------------------------
@@ -231,20 +231,26 @@
231231
# (source start file, target name, title, author,
232232
# dir menu entry, description, category)
233233
texinfo_documents = [
234-
('index', 'pyOptSparse', u'pyOptSparse Documentation',
235-
u'Gaetan Kenway', 'pyOptSparse', 'One line description of project.',
236-
'Miscellaneous'),
234+
(
235+
"index",
236+
"pyOptSparse",
237+
u"pyOptSparse Documentation",
238+
u"Gaetan Kenway",
239+
"pyOptSparse",
240+
"One line description of project.",
241+
"Miscellaneous",
242+
),
237243
]
238244

239245
# Documents to append as an appendix to all manuals.
240-
#texinfo_appendices = []
246+
# texinfo_appendices = []
241247

242248
# If false, no module index is generated.
243-
#texinfo_domain_indices = True
249+
# texinfo_domain_indices = True
244250

245251
# How to display URL addresses: 'footnote', 'no', or 'inline'.
246-
#texinfo_show_urls = 'footnote'
252+
# texinfo_show_urls = 'footnote'
247253

248254

249255
# Example configuration for intersphinx: refer to the Python standard library.
250-
intersphinx_mapping = {}#'http://docs.python.org/': None}
256+
intersphinx_mapping = {} #'http://docs.python.org/': None}

0 commit comments

Comments
 (0)