1212
1313import os
1414import sys
15-
16- import sphinx_rtd_theme
1715from unittest import mock
1816
19- sys .path .insert (0 , os .path .abspath (' ../../python' ))
17+ sys .path .insert (0 , os .path .abspath (" ../../python" ))
2018
2119
2220# -- Project information -----------------------------------------------------
2321
24- project = ' stempy'
25- copyright = ' 2020, Kitware, INC'
26- author = ' Kitware, INC'
22+ project = " stempy"
23+ copyright = " 2020, Kitware, INC"
24+ author = " Kitware, INC"
2725
2826# The full version, including alpha/beta/rc tags
29- release = ' 1.0'
27+ release = " 1.0"
3028
3129
3230# -- General configuration ---------------------------------------------------
3331
3432# Add any Sphinx extension module names here, as strings. They can be
3533# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3634# ones.
37- extensions = [
38- 'sphinx.ext.autodoc' ,
39- 'sphinx_rtd_theme' ,
40- 'recommonmark'
41- ]
35+ extensions = ["sphinx.ext.autodoc" , "sphinx_rtd_theme" , "recommonmark" ]
4236
4337# Add any paths that contain templates here, relative to this directory.
44- templates_path = [' _templates' ]
38+ templates_path = [" _templates" ]
4539
4640# List of patterns, relative to source directory, that match files and
4741# directories to ignore when looking for source files.
4842# This pattern also affects html_static_path and html_extra_path.
4943exclude_patterns = []
5044
45+
5146# Unfortunately, if we have a class that inherits sphinx's mock
5247# object, and we use that class in a default argument, we run into
5348# attribute errors. Fix it by defining an explicit mock of the class.
5449class MockReader :
5550 class H5Format :
5651 Frame = 1
5752
58- sys .modules ['stempy._io' ] = mock .Mock ()
59- _io_mock = sys .modules ['stempy._io' ]
53+
54+ sys .modules ["stempy._io" ] = mock .Mock ()
55+ _io_mock = sys .modules ["stempy._io" ]
6056
6157# We have to override these so we get don't get conflicting metaclasses
6258_io_mock ._sector_reader = MockReader
@@ -70,36 +66,33 @@ class H5Format:
7066# The theme to use for HTML and HTML Help pages. See the documentation for
7167# a list of builtin themes.
7268#
73- html_theme = ' sphinx_rtd_theme'
69+ html_theme = " sphinx_rtd_theme"
7470
7571# Add any paths that contain custom static files (such as style sheets) here,
7672# relative to this directory. They are copied after the builtin static files,
7773# so a file named "default.css" will overwrite the builtin "default.css".
78- html_static_path = [' _static' ]
74+ html_static_path = [" _static" ]
7975
8076# Get autodoc to mock these imports, because we don't actually need them
8177# for generating the docs
82- autodoc_mock_imports = [
83- 'stempy._image' ,
84- 'numpy' ,
85- 'h5py'
86- ]
78+ autodoc_mock_imports = ["stempy._image" , "numpy" , "h5py" ]
79+
8780
8881# Modify this function to customize which classes/functions are skipped
8982def autodoc_skip_member_handler (app , what , name , obj , skip , options ):
9083 # Exclude any names that start with a string in this list
91- exclude_startswith_list = ['_' ]
84+ exclude_startswith_list = ["_" ]
9285
93- if any ([ name .startswith (x ) for x in exclude_startswith_list ] ):
86+ if any (name .startswith (x ) for x in exclude_startswith_list ):
9487 return True
9588
9689 # Exclude any names that match a string in this list
9790 exclude_names = [
98- ' ReaderMixin' ,
99- ' PyReader' ,
100- ' SectorReader' ,
101- ' get_hdf5_reader' ,
102- ' SectorThreadedMultiPassReader' ,
91+ " ReaderMixin" ,
92+ " PyReader" ,
93+ " SectorReader" ,
94+ " get_hdf5_reader" ,
95+ " SectorThreadedMultiPassReader" ,
10396 ]
10497
10598 return name in exclude_names
@@ -109,4 +102,4 @@ def autodoc_skip_member_handler(app, what, name, obj, skip, options):
109102def setup (app ):
110103 # Connect the autodoc-skip-member event from apidoc to the callback
111104 # This allows us to customize which classes/functions are skipped
112- app .connect (' autodoc-skip-member' , autodoc_skip_member_handler )
105+ app .connect (" autodoc-skip-member" , autodoc_skip_member_handler )
0 commit comments