Skip to content

Commit

Permalink
Format source files with isort, black, and autoflake and pre-commit f…
Browse files Browse the repository at this point in the history
…ramework.
  • Loading branch information
ChihweiLHBird committed May 7, 2021
1 parent f0ced4c commit 74b09c3
Show file tree
Hide file tree
Showing 26 changed files with 347 additions and 288 deletions.
78 changes: 45 additions & 33 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,36 +31,38 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages']
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"sphinx.ext.githubpages",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = 'SciUnit'
copyright = '2017, Rick Gerkin and Cyrus Omar'
author = 'Rick Gerkin and Cyrus Omar'
project = "SciUnit"
copyright = "2017, Rick Gerkin and Cyrus Omar"
author = "Rick Gerkin and Cyrus Omar"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = ''
version = ""
# The full version, including alpha/beta/rc tags.
release = ''
release = ""

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -75,7 +77,7 @@
exclude_patterns = []

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
Expand All @@ -86,7 +88,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
#html_theme = 'bizstyle'
# html_theme = 'bizstyle'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand All @@ -97,13 +99,13 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]


# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'SciUnitdoc'
htmlhelp_basename = "SciUnitdoc"


# -- Options for LaTeX output ---------------------------------------------
Expand All @@ -112,15 +114,12 @@
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -130,19 +129,21 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'SciUnit.tex', 'SciUnit Documentation',
'Rick Gerkin and Cyrus Omar', 'manual'),
(
master_doc,
"SciUnit.tex",
"SciUnit Documentation",
"Rick Gerkin and Cyrus Omar",
"manual",
),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'sciunit', 'SciUnit Documentation',
[author], 1)
]
man_pages = [(master_doc, "sciunit", "SciUnit Documentation", [author], 1)]


# -- Options for Texinfo output -------------------------------------------
Expand All @@ -151,25 +152,36 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'SciUnit', 'SciUnit Documentation',
author, 'SciUnit', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"SciUnit",
"SciUnit Documentation",
author,
"SciUnit",
"One line description of project.",
"Miscellaneous",
),
]




# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
intersphinx_mapping = {"https://docs.python.org/": None}

# Removing those three member from the documents to avoid mess. More members can be added in the future.
def remove_variables(app, what, name, obj, skip, options):
if name == "_url":
print("-----------------------")
print(what)
excluded = ["normalization_rules", "rules", "validation_rules", "__dict__", "__doc__"]
excluded = [
"normalization_rules",
"rules",
"validation_rules",
"__dict__",
"__doc__",
]
return name in excluded


# Connecting remove_variables and autodoc-skip-member to setup the event handler.
def setup(app):
app.connect('autodoc-skip-member', remove_variables)
app.connect("autodoc-skip-member", remove_variables)
2 changes: 1 addition & 1 deletion sciunit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import logging
import sys

from .base import config, __version__, logger, log
from .base import __version__, config, log, logger
from .capabilities import Capability
from .errors import Error
from .models import Model
Expand Down

0 comments on commit 74b09c3

Please sign in to comment.