Skip to content

Commit ac67b6a

Browse files
author
Maximilian Maahn
committed
Applied black
1 parent 6df4906 commit ac67b6a

4 files changed

Lines changed: 582 additions & 503 deletions

File tree

docs/conf.py

Lines changed: 84 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,38 @@
1111
# All configuration values have a default; values that are commented out
1212
# serve to show the default.
1313

14-
import sys, os
14+
import os
15+
import sys
1516

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

2122
# -- General configuration -----------------------------------------------------
2223

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

2627
# Add any Sphinx extension module names here, as strings. They can be extensions
2728
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
28-
extensions = ['sphinx.ext.autodoc','sphinx.ext.napoleon']
29+
extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon"]
2930

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

3334
# The suffix of source filenames.
34-
source_suffix = '.rst'
35+
source_suffix = ".rst"
3536

3637
# The encoding of source files.
37-
#source_encoding = 'utf-8-sig'
38+
# source_encoding = 'utf-8-sig'
3839

3940
# The master toctree document.
40-
master_doc = 'index'
41+
master_doc = "index"
4142

4243
# General information about the project.
43-
project = u'pyOptimalEstimation'
44-
copyright = u'2021, M. Maahn'
44+
project = "pyOptimalEstimation"
45+
copyright = "2021, M. Maahn"
4546

4647
# The version info for the project you're documenting, acts as replacement for
4748
# |version| and |release|, also used in various other places throughout the
@@ -51,179 +52,187 @@
5152

5253
try:
5354
from importlib.metadata import version
54-
except ImportError: # for Pyton 3.6 and 3.7
55+
except ImportError: # for Pyton 3.6 and 3.7
5556
from importlib_metadata import version
5657

57-
release = version('pyOptimalEstimation')
58-
version = '.'.join(release.split('.')[:2])
58+
release = version("pyOptimalEstimation")
59+
version = ".".join(release.split(".")[:2])
5960

6061
# The language for content autogenerated by Sphinx. Refer to documentation
6162
# for a list of supported languages.
62-
#language = None
63+
# language = None
6364

6465
# There are two options for replacing |today|: either, you set today to some
6566
# non-false value, then it is used:
66-
#today = ''
67+
# today = ''
6768
# Else, today_fmt is used as the format for a strftime call.
68-
#today_fmt = '%B %d, %Y'
69+
# today_fmt = '%B %d, %Y'
6970

7071
# List of patterns, relative to source directory, that match files and
7172
# directories to ignore when looking for source files.
72-
exclude_patterns = ['_build']
73+
exclude_patterns = ["_build"]
7374

7475
# The reST default role (used for this markup: `text`) to use for all documents.
75-
#default_role = None
76+
# default_role = None
7677

7778
# If true, '()' will be appended to :func: etc. cross-reference text.
78-
#add_function_parentheses = True
79+
# add_function_parentheses = True
7980

8081
# If true, the current module name will be prepended to all description
8182
# unit titles (such as .. function::).
82-
#add_module_names = True
83+
# add_module_names = True
8384

8485
# If true, sectionauthor and moduleauthor directives will be shown in the
8586
# output. They are ignored by default.
86-
#show_authors = False
87+
# show_authors = False
8788

8889
# The name of the Pygments (syntax highlighting) style to use.
89-
pygments_style = 'sphinx'
90+
pygments_style = "sphinx"
9091

9192
# A list of ignored prefixes for module index sorting.
92-
#modindex_common_prefix = []
93+
# modindex_common_prefix = []
9394

9495

9596
# -- Options for HTML output ---------------------------------------------------
9697

9798
# The theme to use for HTML and HTML Help pages. See the documentation for
9899
# a list of builtin themes.
99-
html_theme = 'alabaster'
100+
html_theme = "alabaster"
100101

101102
# Theme options are theme-specific and customize the look and feel of a theme
102103
# further. For a list of options available for each theme, see the
103104
# documentation.
104-
#html_theme_options = {}
105+
# html_theme_options = {}
105106

106107
# Add any paths that contain custom themes here, relative to this directory.
107-
#html_theme_path = []
108+
# html_theme_path = []
108109

109110
# The name for this set of Sphinx documents. If None, it defaults to
110111
# "<project> v<release> documentation".
111-
#html_title = None
112+
# html_title = None
112113

113114
# A shorter title for the navigation bar. Default is the same as html_title.
114-
#html_short_title = None
115+
# html_short_title = None
115116

116117
# The name of an image file (relative to this directory) to place at the top
117118
# of the sidebar.
118-
#html_logo = None
119+
# html_logo = None
119120

120121
# The name of an image file (within the static path) to use as favicon of the
121122
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
122123
# pixels large.
123-
#html_favicon = None
124+
# html_favicon = None
124125

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

130131
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
131132
# using the given strftime format.
132-
#html_last_updated_fmt = '%b %d, %Y'
133+
# html_last_updated_fmt = '%b %d, %Y'
133134

134135
# If true, SmartyPants will be used to convert quotes and dashes to
135136
# typographically correct entities.
136-
#html_use_smartypants = True
137+
# html_use_smartypants = True
137138

138139
# Custom sidebar templates, maps document names to template names.
139-
#html_sidebars = {}
140+
# html_sidebars = {}
140141

141142
# Additional templates that should be rendered to pages, maps page names to
142143
# template names.
143-
#html_additional_pages = {}
144+
# html_additional_pages = {}
144145

145146
# If false, no module index is generated.
146-
#html_domain_indices = True
147+
# html_domain_indices = True
147148

148149
# If false, no index is generated.
149-
#html_use_index = True
150+
# html_use_index = True
150151

151152
# If true, the index is split into individual pages for each letter.
152-
#html_split_index = False
153+
# html_split_index = False
153154

154155
# If true, links to the reST sources are added to the pages.
155-
#html_show_sourcelink = True
156+
# html_show_sourcelink = True
156157

157158
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
158-
#html_show_sphinx = True
159+
# html_show_sphinx = True
159160

160161
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
161-
#html_show_copyright = True
162+
# html_show_copyright = True
162163

163164
# If true, an OpenSearch description file will be output, and all pages will
164165
# contain a <link> tag referring to it. The value of this option must be the
165166
# base URL from which the finished HTML is served.
166-
#html_use_opensearch = ''
167+
# html_use_opensearch = ''
167168

168169
# This is the file name suffix for HTML files (e.g. ".xhtml").
169-
#html_file_suffix = None
170+
# html_file_suffix = None
170171

171172
# Output file base name for HTML help builder.
172-
htmlhelp_basename = 'pyOptimalEstimationdoc'
173+
htmlhelp_basename = "pyOptimalEstimationdoc"
173174

174175

175176
# -- Options for LaTeX output --------------------------------------------------
176177

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

188187
# Grouping the document tree into LaTeX files. List of tuples
189188
# (source start file, target name, title, author, documentclass [howto/manual]).
190189
latex_documents = [
191-
('index', 'pyOptimalEstimation.tex', u'pyOptimalEstimation Documentation',
192-
u'M. Maahn', 'manual'),
190+
(
191+
"index",
192+
"pyOptimalEstimation.tex",
193+
"pyOptimalEstimation Documentation",
194+
"M. Maahn",
195+
"manual",
196+
),
193197
]
194198

195199
# The name of an image file (relative to this directory) to place at the top of
196200
# the title page.
197-
#latex_logo = None
201+
# latex_logo = None
198202

199203
# For "manual" documents, if this is true, then toplevel headings are parts,
200204
# not chapters.
201-
#latex_use_parts = False
205+
# latex_use_parts = False
202206

203207
# If true, show page references after internal links.
204-
#latex_show_pagerefs = False
208+
# latex_show_pagerefs = False
205209

206210
# If true, show URL addresses after external links.
207-
#latex_show_urls = False
211+
# latex_show_urls = False
208212

209213
# Documents to append as an appendix to all manuals.
210-
#latex_appendices = []
214+
# latex_appendices = []
211215

212216
# If false, no module index is generated.
213-
#latex_domain_indices = True
217+
# latex_domain_indices = True
214218

215219

216220
# -- Options for manual page output --------------------------------------------
217221

218222
# One entry per manual page. List of tuples
219223
# (source start file, name, description, authors, manual section).
220224
man_pages = [
221-
('index', 'pyoptimalestimation', u'pyOptimalEstimation Documentation',
222-
[u'M. Maahn'], 1)
225+
(
226+
"index",
227+
"pyoptimalestimation",
228+
"pyOptimalEstimation Documentation",
229+
["M. Maahn"],
230+
1,
231+
)
223232
]
224233

225234
# If true, show URL addresses after external links.
226-
#man_show_urls = False
235+
# man_show_urls = False
227236

228237

229238
# -- Options for Texinfo output ------------------------------------------------
@@ -232,16 +241,22 @@
232241
# (source start file, target name, title, author,
233242
# dir menu entry, description, category)
234243
texinfo_documents = [
235-
('index', 'pyOptimalEstimation', u'pyOptimalEstimation Documentation',
236-
u'M. Maahn', 'pyOptimalEstimation', 'One line description of project.',
237-
'Miscellaneous'),
244+
(
245+
"index",
246+
"pyOptimalEstimation",
247+
"pyOptimalEstimation Documentation",
248+
"M. Maahn",
249+
"pyOptimalEstimation",
250+
"One line description of project.",
251+
"Miscellaneous",
252+
),
238253
]
239254

240255
# Documents to append as an appendix to all manuals.
241-
#texinfo_appendices = []
256+
# texinfo_appendices = []
242257

243258
# If false, no module index is generated.
244-
#texinfo_domain_indices = True
259+
# texinfo_domain_indices = True
245260

246261
# How to display URL addresses: 'footnote', 'no', or 'inline'.
247-
#texinfo_show_urls = 'footnote'
262+
# texinfo_show_urls = 'footnote'

pyOptimalEstimation/examples/dsd_radar.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@
1010
# maximilian.maahn@uni-leipzig.de
1111
# https://github.com/maahn/pyOptimalEstimation
1212
"""
13-
from __future__ import absolute_import
14-
from __future__ import division
15-
from __future__ import print_function
16-
from __future__ import unicode_literals
17-
import numpy as np
13+
from __future__ import absolute_import, division, print_function, unicode_literals
14+
1815
import matplotlib.pyplot as plt
16+
import numpy as np
1917
import pyOptimalEstimation as pyOE
2018

2119
# Define the forward operator, accepts state vector X [N0,lam] as input, and
@@ -31,8 +29,8 @@ def forward(X, D=np.logspace(-4, -2, 50)):
3129
N0 = 10**N0log
3230
dD = np.gradient(D)
3331
N = N0 * np.exp(-lam * D**mu)
34-
Z = 1e18 * np.sum(N*D**6*dD)
35-
return [10*np.log10(Z)]
32+
Z = 1e18 * np.sum(N * D**6 * dD)
33+
return [10 * np.log10(Z)]
3634

3735

3836
# define names for X and Y
@@ -57,9 +55,8 @@ def forward(X, D=np.logspace(-4, -2, 50)):
5755

5856
# create optimal estimation object
5957
oe = pyOE.optimalEstimation(
60-
x_vars, x_ap, x_cov, y_vars, y_obs, y_cov, forward,
61-
forwardKwArgs=forwardKwArgs
62-
)
58+
x_vars, x_ap, x_cov, y_vars, y_obs, y_cov, forward, forwardKwArgs=forwardKwArgs
59+
)
6360

6461
# run the retrieval
6562
oe.doRetrieval(maxIter=10, maxTime=10000000.0)

0 commit comments

Comments
 (0)