1818import re
1919import sys
2020import datetime
21- sys .path .append ('..' )
21+
22+ sys .path .append (".." )
2223
2324# -- Project information -----------------------------------------------------
2425
25- project = 'Segmentation Models'
26- copyright = '{}, Pavel Iakubovskii' .format (datetime .datetime .now ().year )
27- author = 'Pavel Iakubovskii'
26+ project = "Segmentation Models"
27+ copyright = "{}, Pavel Iakubovskii" .format (datetime .datetime .now ().year )
28+ author = "Pavel Iakubovskii"
29+
2830
2931def get_version ():
30- sys .path .append (' ../segmentation_models_pytorch' )
32+ sys .path .append (" ../segmentation_models_pytorch" )
3133 from __version__ import __version__ as version
34+
3235 sys .path .pop (- 1 )
3336 return version
3437
38+
3539version = get_version ()
3640
3741# -- General configuration ---------------------------------------------------
@@ -41,16 +45,16 @@ def get_version():
4145# ones.
4246
4347extensions = [
44- ' sphinx.ext.autodoc' ,
45- ' sphinx.ext.coverage' ,
46- ' sphinx.ext.napoleon' ,
47- ' sphinx.ext.viewcode' ,
48- ' sphinx.ext.mathjax' ,
49- ' autodocsumm' ,
48+ " sphinx.ext.autodoc" ,
49+ " sphinx.ext.coverage" ,
50+ " sphinx.ext.napoleon" ,
51+ " sphinx.ext.viewcode" ,
52+ " sphinx.ext.mathjax" ,
53+ " autodocsumm" ,
5054]
5155
5256# Add any paths that contain templates here, relative to this directory.
53- templates_path = [' _templates' ]
57+ templates_path = [" _templates" ]
5458
5559# List of patterns, relative to source directory, that match files and
5660# directories to ignore when looking for source files.
@@ -65,12 +69,14 @@ def get_version():
6569#
6670
6771import sphinx_rtd_theme
72+
6873html_theme = "sphinx_rtd_theme"
6974html_theme_path = [sphinx_rtd_theme .get_html_theme_path ()]
7075
7176# import karma_sphinx_theme
7277# html_theme = "karma_sphinx_theme"
7378import faculty_sphinx_theme
79+
7480html_theme = "faculty_sphinx_theme"
7581
7682# import catalyst_sphinx_theme
@@ -82,7 +88,7 @@ def get_version():
8288# Add any paths that contain custom static files (such as style sheets) here,
8389# relative to this directory. They are copied after the builtin static files,
8490# so a file named "default.css" will overwrite the builtin "default.css".
85- html_static_path = [' _static' ]
91+ html_static_path = [" _static" ]
8692
8793# -- Extension configuration -------------------------------------------------
8894
@@ -92,37 +98,40 @@ def get_version():
9298napoleon_numpy_docstring = False
9399
94100autodoc_mock_imports = [
95- ' torch' ,
96- ' tqdm' ,
97- ' numpy' ,
98- ' timm' ,
99- ' cv2' ,
100- ' PIL' ,
101- ' pretrainedmodels' ,
102- ' torchvision' ,
103- ' efficientnet-pytorch' ,
104- ' segmentation_models_pytorch.encoders' ,
105- ' segmentation_models_pytorch.utils' ,
101+ " torch" ,
102+ " tqdm" ,
103+ " numpy" ,
104+ " timm" ,
105+ " cv2" ,
106+ " PIL" ,
107+ " pretrainedmodels" ,
108+ " torchvision" ,
109+ " efficientnet-pytorch" ,
110+ " segmentation_models_pytorch.encoders" ,
111+ " segmentation_models_pytorch.utils" ,
106112 # 'segmentation_models_pytorch.base',
107113]
108114
109- autoclass_content = ' both'
110- autodoc_typehints = ' description'
115+ autoclass_content = " both"
116+ autodoc_typehints = " description"
111117
112118# --- Work around to make autoclass signatures not (*args, **kwargs) ----------
113119
114- class FakeSignature ():
120+
121+ class FakeSignature :
115122 def __getattribute__ (self , * args ):
116123 raise ValueError
117124
125+
118126def f (app , obj , bound_method ):
119127 if "__new__" in obj .__name__ :
120128 obj .__signature__ = FakeSignature ()
121129
130+
122131def setup (app ):
123- app .connect (' autodoc-before-process-signature' , f )
132+ app .connect (" autodoc-before-process-signature" , f )
124133
125134
126135# Custom configuration --------------------------------------------------------
127136
128- autodoc_member_order = ' bysource'
137+ autodoc_member_order = " bysource"
0 commit comments