Skip to content

Commit

Permalink
Make precommit happy with our Python
Browse files Browse the repository at this point in the history
  • Loading branch information
tumido committed Oct 21, 2020
1 parent f2f293a commit 5eebead
Show file tree
Hide file tree
Showing 16 changed files with 189 additions and 159 deletions.
20 changes: 13 additions & 7 deletions .jupyter/jupyter_nbconvert_config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# type: ignore
# flake8: noqa

"""Configuration file for Jupyter NB Convert."""

## Set the log level by value or name.
c.Application.log_level = "DEBUG"

Expand All @@ -7,17 +12,17 @@
## The Logging format template
# Let's at least try for an logstash format
c.Application.log_format = (
'{'
"{"
'"@timestamp": "%(asctime)s", '
'"@version": 1, '
'"level": "%(levelname)s", '
'"name": "%(name)s", '
'"message": "%(message)s"'
'}'
"}"
)

## Writer class used to write the results of the conversion
c.NbConvertApp.writer_class = 'FilesWriter'
c.NbConvertApp.writer_class = "FilesWriter"

## The time to wait (in seconds) for output from executions. If a cell execution
# takes longer, an exception (TimeoutError on python 3+, RuntimeError on python
Expand All @@ -42,15 +47,16 @@

## Automation specific settings
import os
if os.getenv('RUN_IN_AUTOMATION'):

if os.getenv("RUN_IN_AUTOMATION"):
from pathlib import Path

## Directory to write output(s) to. Defaults to output to the directory of each
# notebook. To recover previous default behaviour (outputting to the current
# working directory) use . as the flag value.
base_dir = Path(os.getenv('LOCAL_DATA_PATH'))
notebook_dir = Path(os.getenv('NOTEBOOK_NAME')).parent
c.FilesWriter.build_directory = str(base_dir / 'notebooks' / notebook_dir)
base_dir = Path(os.getenv("LOCAL_DATA_PATH"))
notebook_dir = Path(os.getenv("NOTEBOOK_NAME")).parent
c.FilesWriter.build_directory = str(base_dir / "notebooks" / notebook_dir)

## Whether to apply a suffix prior to the extension (only relevant when
# converting to notebook format). The suffix is determined by the exporter, and
Expand Down
1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

61 changes: 36 additions & 25 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Documentation builder configuration."""

# -*- coding: utf-8 -*-
#
# project-template documentation build configuration file, created by
Expand All @@ -11,9 +13,6 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import os
import sys

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
Expand All @@ -29,28 +28,28 @@
extensions = []

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

# The suffix of source filenames.
source_suffix = '.rst'
source_suffix = ".rst"

# The encoding of source files.
# source_encoding = 'utf-8-sig'

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

# General information about the project.
project = u'project-template'
project = u"project-template"

# 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 = '0.1'
version = "0.1"
# The full version, including alpha/beta/rc tags.
release = '0.1'
release = "0.1"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -64,7 +63,7 @@

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

# The reST default role (used for this markup: `text`) to use for all documents.
# default_role = None
Expand All @@ -81,7 +80,7 @@
# show_authors = False

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

# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
Expand All @@ -91,7 +90,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
html_theme = "default"

# 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 Down Expand Up @@ -120,7 +119,7 @@
# 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"]

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
Expand Down Expand Up @@ -164,29 +163,30 @@
# html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = 'project-templatedoc'
htmlhelp_basename = "project-templatedoc"


# -- Options for LaTeX output --------------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',

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

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

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index',
'project-template.tex',
u'project-template Documentation',
u"aicoe-aiops", 'manual'),
(
"index",
"project-template.tex",
u"project-template Documentation",
u"aicoe-aiops",
"manual",
),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -215,8 +215,13 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'project-template', u'project-template Documentation',
[u"aicoe-aiops"], 1)
(
"index",
"project-template",
u"project-template Documentation",
[u"aicoe-aiops"],
1,
)
]

# If true, show URL addresses after external links.
Expand All @@ -229,9 +234,15 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'project-template', u'project-template Documentation',
u"aicoe-aiops", 'project-template',
'template for the team to use', 'Miscellaneous'),
(
"index",
"project-template",
u"project-template Documentation",
u"aicoe-aiops",
"project-template",
"template for the team to use",
"Miscellaneous",
),
]

# Documents to append as an appendix to all manuals.
Expand Down
Loading

0 comments on commit 5eebead

Please sign in to comment.