def test_ExplicitOrder_sorting_key(): """Test ExplicitOrder""" all_folders = ['e', 'f', 'd', 'c', '01b', 'a'] explicit_folders = ['f', 'd'] key = ExplicitOrder(explicit_folders) sorted_folders = sorted(["d", "f"], key=key) assert sorted_folders == explicit_folders # Test fails on wrong input with pytest.raises(ValueError) as excinfo: ExplicitOrder('nope') excinfo.match("ExplicitOrder sorting key takes a list") # Test missing folder with pytest.raises(ValueError) as excinfo: sorted_folders = sorted(all_folders, key=key) excinfo.match('If you use an explicit folder ordering') # str(obj) stability for sphinx non-rebuilds assert str(key).startswith('<ExplicitOrder : ') assert str(key) == str(ExplicitOrder(explicit_folders)) assert str(key) != str(ExplicitOrder(explicit_folders[::-1])) src_dir = op.dirname(__file__) for klass, type_ in ((NumberOfCodeLinesSortKey, int), (FileNameSortKey, basestring), (FileSizeSortKey, int), (ExampleTitleSortKey, basestring)): sorter = klass(src_dir) assert str(sorter) == '<%s>' % (klass.__name__, ) out = sorter(op.basename(__file__)) assert isinstance(out, type_), type(out)
def test_ExplicitOrder_sorting_key(): """Test ExplicitOrder""" from sphinx_gallery.sorting import ExplicitOrder all_folders = ['e', 'f', 'd', 'c', '01b', 'a'] explicit_folders = ['f', 'd'] key = ExplicitOrder(explicit_folders) sorted_folders = sorted(["d", "f"], key=key) assert sorted_folders == explicit_folders # Test fails on wrong input with pytest.raises(ValueError) as excinfo: ExplicitOrder('nope') excinfo.match("ExplicitOrder sorting key takes a list") # Test missing folder with pytest.raises(ValueError) as excinfo: sorted_folders = sorted(all_folders, key=key) excinfo.match('If you use an explicit folder ordering')
"matplotlib": ("https://matplotlib.org/", None), } from sphinx_gallery.sorting import ExplicitOrder examples_dirs = ["../tutorials/", "../vta/tutorials/"] gallery_dirs = ["tutorials", "vta/tutorials"] subsection_order = ExplicitOrder([ "../tutorials/get_started", "../tutorials/frontend", "../tutorials/language", "../tutorials/optimize", "../tutorials/autotvm", "../tutorials/auto_scheduler", "../tutorials/dev", "../tutorials/topi", "../tutorials/deployment", "../tutorials/micro", "../vta/tutorials/frontend", "../vta/tutorials/optimize", "../vta/tutorials/autotvm", ]) # Explicitly define the order within a subsection. # The listed files are sorted according to the list. # The unlisted files are sorted by filenames. # The unlisted files always appear after listed files. within_subsection_order = { "get_started": [ "relay_quick_start.py",
# Configuration for the sphinx-gallery from sphinx_gallery.sorting import ExplicitOrder, FileNameSortKey sphinx_gallery_conf = { "examples_dirs": ["gallery-src"], "filename_pattern": re.escape(os.sep) + "run_", "gallery_dirs": [os.path.join("user", "_gallery")], "line_numbers": True, "download_all_examples": False, "subsection_order": ExplicitOrder([ os.path.join("gallery-src", "framework"), os.path.join("gallery-src", "analysis"), os.path.join("gallery-src", "applications"), ]), "within_subsection_order": FileNameSortKey, "default_thumb_file": os.path.join(RES, "images", "TerraPowerLogo.png"), } # filter out this warning which shows up in sphinx-gallery builds. # this is suggested in the sphinx-gallery example but doesn't actually work? warnings.filterwarnings( "ignore", category=UserWarning, message="Matplotlib is currently using agg, which is a non-GUI" " backend, so cannot show the figure.",
intersphinx_mapping = { 'python': ('https://docs.python.org/{.major}'.format(sys.version_info), None), 'numpy': ('https://docs.scipy.org/doc/numpy/', None), 'scipy': ('https://docs.scipy.org/doc/scipy/reference', None), 'matplotlib': ('https://matplotlib.org/', None), } from sphinx_gallery.sorting import ExplicitOrder examples_dirs = ["../tutorials/", "../vta/tutorials/"] gallery_dirs = ["tutorials", "vta/tutorials"] subsection_order = ExplicitOrder([ '../tutorials/frontend', '../tutorials/language', '../tutorials/optimize', '../tutorials/autotvm', '../tutorials/dev', '../tutorials/topi', '../tutorials/deployment', '../vta/tutorials/frontend', '../vta/tutorials/optimize', '../vta/tutorials/autotvm' ]) def generate_doxygen_xml(app): """Run the doxygen make commands if we're on the ReadTheDocs server""" run_doxygen('..') sphinx_gallery_conf = { 'backreferences_dir': 'gen_modules/backreferences', 'doc_module': ('tvm', 'numpy'), 'reference_url': { 'tvm': None, 'matplotlib': 'https://matplotlib.org/',
# -- Options for Auto summary ------------------------------------------- autosummary_generate = True # autoclass_content = 'class' autodoc_default_flags = [ 'members', 'inherited_members', # 'undoc-members', 'show-inheritance' ] # , 'private-members', 'special-members'] autodoc_member_order = 'bysource' # -- Options for Gallery ------------------------------------------- from sphinx_gallery.sorting import ExplicitOrder sphinx_gallery_conf = { # path to your examples scripts 'examples_dirs': '../../examples', 'subsection_order': ExplicitOrder([ '../../examples/simplelife', '../../examples/nestedlife', '../../examples/ifrs17sim' ]), # path where to save gallery generated examples 'gallery_dirs': 'generated_examples', # Suppress warning: 'backreferences_dir': False }
"nb2plots", "texext", ] # https://github.com/sphinx-gallery/sphinx-gallery sphinx_gallery_conf = { # path to your examples scripts "examples_dirs": "../examples", "subsection_order": ExplicitOrder( [ "../examples/basic", "../examples/drawing", "../examples/graph", "../examples/algorithms", "../examples/advanced", "../examples/3d_drawing", "../examples/pygraphviz", "../examples/geospatial", "../examples/javascript", "../examples/jit", "../examples/applications", "../examples/subclass", ] ), # path where to save gallery generated examples "gallery_dirs": "auto_examples", "backreferences_dir": "modules/generated", "image_scrapers": ("matplotlib", "mayavi"), } # generate autosummary pages autosummary_generate = True
'bootswatch_theme': "flatly", # Render the current pages TOC in the navbar 'navbar_pagenav': False, } # Settings for whether to copy over and show link rst source pages html_copy_source = False html_show_sourcelink = False # -- Extension configuration ------------------------------------------------- # Configurations for sphinx gallery sphinx_gallery_conf = { 'examples_dirs': ['../examples', '../tutorials', '../motivations'], 'gallery_dirs': ['auto_examples', 'auto_tutorials', 'auto_motivations'], 'subsection_order' : ExplicitOrder(['../examples/manage', '../examples/plots', '../examples/sims', '../examples/analyses', '../motivations/concepts', '../motivations/measurements']), 'within_subsection_order': FileNameSortKey, 'default_thumb_file': 'img/spectrum.png', 'backreferences_dir': 'generated', # Where to drop linking files between examples & API 'doc_module': ('fooof',), 'reference_url': {'fooof': None}, 'remove_config_comments': True, }
continue explicit_order_folders.append(folder) # Sphinx gallery configuration sphinx_gallery_conf = { 'examples_dirs': ['../examples', '../tutorials'], 'filename_pattern': '^((?!sgskip).)*$', 'gallery_dirs': ['gallery', 'tutorials'], 'doc_module': ('matplotlib', 'mpl_toolkits'), 'reference_url': { 'matplotlib': None, 'numpy': 'https://docs.scipy.org/doc/numpy', 'scipy': 'https://docs.scipy.org/doc/scipy/reference', }, 'backreferences_dir': 'api/_as_gen', 'subsection_order': ExplicitOrder(explicit_order_folders), 'min_reported_time': 1, } plot_gallery = 'True' # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # This is the default encoding, but it doesn't hurt to be explicit source_encoding = "utf-8" # The master toctree document.
example_dir = path.parent.joinpath('examples') sphinx_gallery_conf = { 'backreferences_dir': path.joinpath( 'generated', 'modules'), # path to store the module using example template 'filename_pattern': '^((?!skip_).)*$', # execute all examples except those that start with "skip_" 'examples_dirs': example_dir, # path to the examples scripts 'subsection_order': ExplicitOrder([(os.path.join('..', 'examples/acquiring_data')), (os.path.join('..', 'examples/map')), (os.path.join('..', 'examples/time_series')), (os.path.join('..', 'examples/units_and_coordinates')), (os.path.join('..', 'examples/plotting')), (os.path.join('..', 'examples/saving_and_loading_data')), (os.path.join('..', 'examples/computer_vision_techniques'))]), 'gallery_dirs': path.joinpath('generated', 'gallery'), # path to save gallery generated examples 'default_thumb_file': path.joinpath('logo', 'sunpy_icon_128x128.png'), 'reference_url': { 'sunpy': None, 'astropy': 'http://docs.astropy.org/en/stable/', 'matplotlib': 'https://matplotlib.org/', 'numpy': 'http://docs.scipy.org/doc/numpy/', },
min_reported_time = 0 sphinx_gallery_conf = { "examples_dirs": examples_dirs, "gallery_dirs": gallery_dirs, "subsection_order": ExplicitOrder([ "../core/basic", "../core/intermediate", "../core/advanced", "../core/remote_flyte", "../case_studies/pima_diabetes", "../case_studies/house_price_prediction", "../plugins/pod/", "../plugins/k8s_spark", "../plugins/papermilltasks/", "../plugins/hive", "../plugins/sagemaker_training", "../plugins/kfpytorch", "../plugins/sagemaker_pytorch/", ]), # specify the order of examples to be according to filename "within_subsection_order": CustomSorter, "min_reported_time": min_reported_time, "filename_pattern": "/run_", "capture_repr": (),
'sphinx.ext.napoleon', 'sphinx.ext.todo', 'sphinx.ext.viewcode', 'sphinx_gallery.gen_gallery', 'nb2plots', ] # https://github.com/sphinx-gallery/sphinx-gallery sphinx_gallery_conf = { # path to your examples scripts 'examples_dirs': '../examples', 'subsection_order': ExplicitOrder(['../examples/basic', '../examples/drawing', '../examples/graph', '../examples/algorithms', '../examples/advanced', '../examples/3d_drawing', '../examples/pygraphviz', '../examples/javascript', '../examples/jit', '../examples/subclass']), # path where to save gallery generated examples 'gallery_dirs': 'auto_examples', 'backreferences_dir': 'modules/generated', 'expected_failing_examples': ['../examples/advanced/plot_parallel_betweenness.py'] } # generate autosummary pages autosummary_generate = True # Add any paths that contain templates here, relative to this directory. #templates_path = ['']
# sphinx gallery config sphinx_gallery_conf = { "examples_dirs": ["../examples_source", "../fitting_source"], "remove_config_comments": True, "gallery_dirs": [ "examples", "fitting", ], # path to where to save gallery generated output "within_subsection_order": FileNameSortKey, # "show_memory": True, # "line_numbers": True, "subsection_order": ExplicitOrder( [ "../examples_source/1D_simulation(crystalline)", "../examples_source/1D_simulation(macro_amorphous)", "../examples_source/2D_simulation(crystalline)", "../examples_source/2D_simulation(macro_amorphous)", "../fitting_source/1D_fitting", "../fitting_source/2D_fitting", ] ), "reference_url": { # The module you locally document uses None "mrsimulator": None }, "backreferences_dir": "examples", "doc_module": ("mrsimulator"), # "compress_images": ("images", "thumbnails"), # "show_memory": True, "first_notebook_cell": ( "# This cell is added by sphinx-gallery\n\n" "%matplotlib inline\n\n"
# , 'private-members', 'special-members'] autodoc_member_order = 'bysource' # -- Options for Gallery ------------------------------------------- from sphinx_gallery.sorting import ExplicitOrder sphinx_gallery_conf = { # path to your examples scripts 'ignore_pattern': '^(?!.*plot_)', 'examples_dirs': '../../lifelib/projects', 'subsection_order': ExplicitOrder([ '../../lifelib/projects/simplelife', '../../lifelib/projects/nestedlife', '../../lifelib/projects/ifrs17sim', '../../lifelib/projects/solvency2', '../../lifelib/projects/smithwilson' ]), # path where to save gallery generated examples 'gallery_dirs': 'generated_examples', # Suppress warning: 'backreferences_dir': False, 'download_all_examples': False, 'download_section_examples': False } # blockdiag_fontpath = 'c:/windows/fonts/calibri.ttf'
intersphinx_mapping = { 'python': ('https://docs.python.org/{.major}'.format(sys.version_info), None), 'numpy': ('http://docs.scipy.org/doc/numpy/', None), 'scipy': ('http://docs.scipy.org/doc/scipy/reference', None), 'matplotlib': ('http://matplotlib.org/', None), } from sphinx_gallery.sorting import ExplicitOrder examples_dirs = ['../tutorials/'] gallery_dirs = ['tutorials'] subsection_order = ExplicitOrder([ '../tutorials/language', '../tutorials/optimize', '../tutorials/topi', '../tutorials/deployment', '../tutorials/nnvm' ]) def generate_doxygen_xml(app): """Run the doxygen make commands if we're on the ReadTheDocs server""" run_doxygen('..') def setup(app): # Add hook for building doxygen xml when needed # no c++ API for now app.connect("builder-inited", generate_doxygen_xml) app.add_stylesheet('css/tvm_theme.css') app.add_config_value('recommonmark_config', { 'url_resolver': lambda url: github_doc_root + url,
"examples_dirs": [ "../examples/gallery", "../examples/tutorials", "../examples/projections", ], # path where to save gallery generated examples "gallery_dirs": ["gallery", "tutorials", "projections"], "subsection_order": ExplicitOrder([ "../examples/gallery/maps", "../examples/gallery/lines", "../examples/gallery/symbols", "../examples/gallery/images", "../examples/gallery/3d_plots", "../examples/gallery/seismology", "../examples/gallery/basemaps", "../examples/gallery/embellishments", "../examples/projections/azim", "../examples/projections/conic", "../examples/projections/cyl", "../examples/projections/misc", "../examples/projections/nongeo", "../examples/projections/table", ]), # Patter to search for example files "filename_pattern": r"\.py", # Remove the "Download all examples" button from the top level gallery "download_all_examples": False, # Sort gallery example by file name instead of number of lines (default) "within_subsection_order":
# image_scrapers = ('matplotlib',) image_scrapers = () min_reported_time = 0 sphinx_gallery_conf = { "examples_dirs": examples_dirs, "gallery_dirs": gallery_dirs, "subsection_order": ExplicitOrder( [ "../recipes/core/basic", "../recipes/core/intermediate", "../recipes/core/advanced", "../recipes/core/remote_flyte", "../recipes/case_studies/pima_diabetes", "../recipes/plugins/hive", "../recipes/plugins/sagemaker_training", "../recipes/plugins/k8s_spark", "../recipes/plugins/kfpytorch", "../recipes/plugins/pod/", "../recipes/plugins/sagemaker_pytorch/", ] ), # specify the order of examples to be according to filename "within_subsection_order": CustomSorter, "min_reported_time": min_reported_time, "filename_pattern": "/run_", "capture_repr": (), "image_scrapers": image_scrapers, "default_thumb_file": "flyte_mark_offset_pink.png", # Support for binder
True, ) app.add_transform(AutoStructify) app.add_javascript("google_analytics.js") sphinx_gallery_conf = { "backreferences_dir": "gen_modules/backreferences", "doc_module": ("gluonts", "mxnet", "numpy"), "reference_url": { "gluonts": None, "numpy": "http://docs.scipy.org/doc/numpy-1.9.1", }, "examples_dirs": [], "gallery_dirs": [], "subsection_order": ExplicitOrder([]), "find_mayavi_figures": False, "filename_pattern": ".py", "expected_failing_examples": [], } # Napoleon settings napoleon_use_ivar = True # linkcheck settings import multiprocessing linkcheck_ignore = [r"http[s]://apache-mxnet.s3*"] linkcheck_retries = 3 linkcheck_workers = int(multiprocessing.cpu_count() / 2)
'style_external_links': True, 'navigation_depth': 4, 'titles_only': False } html_logo = "_static/logo_light.png" html_show_sourcelink = True # sphinx-gallery configuration ## sphinx_gallery_conf = { # path to your example scripts 'examples_dirs': ['../examples/'], "subsection_order": ExplicitOrder([ "../examples/sparse", "../examples/glm", "../examples/vae_prior", ]), 'gallery_dirs': ['gallery'], 'backreferences_dir': 'modules/backreferences', 'doc_module': ('tramp'), 'image_scrapers': ('matplotlib'), } # show section and code author show_authors = True # Custom theme html_copy_source = False html_css_files = [
except Exception: result = "" os.environ.pop("PLOTLY_RENDERER") return result image_scrapers = (plotly_sg_scraper_nb, ) example_dirs = ["draw_examples"] gallery_dirs = ["draw"] sphinx_gallery_conf = { "examples_dirs": example_dirs, "subsection_order": ExplicitOrder(["draw_examples/aln", "draw_examples/tree"]), "abort_on_example_error": True, "within_subsection_order": FileNameSortKey, "gallery_dirs": gallery_dirs, "image_scrapers": image_scrapers, "download_all_examples": False, } # -- Options for LaTeX output -------------------------------------------------- latex_documents = [("index", "cogent3.tex", "cogent3 Documentation", "cogent3 Team", "manual")] def setup(app): app.add_js_file("plotly-latest.min.js")
"index": ["sidebarintro.html"], "**": ["sidebarintro.html", "localtoc.html", "searchbox.html"], } html_static_path = ["_static"] htmlhelp_basename = "glyphdoc" html_show_sourcelink = False html_show_sphinx = False html_show_copyright = True intersphinx_mapping = { "python": ("http://docs.python.org/3.6", None), "deap": ("http://deap.readthedocs.io/en/master/", None), "np": ("http://docs.scipy.org/doc/numpy", None), "scipy": ("http://docs.scipy.org/doc/scipy/reference", None), } default_role = "any" sphinx_gallery_conf = { "examples_dirs": "../../examples", # path to your example scripts "gallery_dirs": "usr/examples", # path where to save gallery generated examples "subsection_order": ExplicitOrder(["../../examples/symbolic_regression"]), "within_subsection_order": NumberOfCodeLinesSortKey, "filename_pattern": "/*.py", "ignore_pattern": r"observer\.py", # "show_memory": True, }
"texext", "numpydoc", ] # https://github.com/sphinx-gallery/sphinx-gallery sphinx_gallery_conf = { # path to your examples scripts "examples_dirs": "../examples", "subsection_order": ExplicitOrder( [ "../examples/basic", "../examples/drawing", "../examples/3d_drawing", "../examples/graphviz_layout", "../examples/graphviz_drawing", "../examples/graph", "../examples/algorithms", "../examples/advanced", "../examples/external", "../examples/geospatial", "../examples/subclass", ] ), "within_subsection_order": FileNameSortKey, # path where to save gallery generated examples "gallery_dirs": "auto_examples", "backreferences_dir": "modules/generated", "image_scrapers": ("matplotlib",), } # Add pygraphviz png scraper, if available try:
sphinx_gallery_conf = { 'backreferences_dir': 'gen_modules/backreferences', 'doc_module': ('sphinx_gallery', 'numpy'), 'reference_url': { 'sphinx_gallery': None, }, 'examples_dirs': examples_dirs, 'gallery_dirs': gallery_dirs, 'image_scrapers': image_scrapers, 'subsection_order': ExplicitOrder([ '../examples/sin_func', '../examples/no_output', '../tutorials/seaborn' ]), 'within_subsection_order': NumberOfCodeLinesSortKey, 'expected_failing_examples': [ '../examples/no_output/plot_raise.py', '../examples/no_output/plot_syntaxerror.py' ], 'min_reported_time': min_reported_time, 'binder': { 'org': 'sphinx-gallery', 'repo': 'sphinx-gallery.github.io', 'url': 'https://mybinder.org', 'branch': 'master', 'dependencies': './binder/requirements.txt',
app.add_js_file('google_analytics.js') app.add_js_file('hidebib.js') app.add_js_file('install-options.js') app.add_css_file('custom.css') sphinx_gallery_conf = { 'backreferences_dir': 'gen_modules/backreferences', 'doc_module': ('gluonnlp', 'mxnet', 'numpy'), 'reference_url': { 'gluonnlp': None, 'numpy': 'http://docs.scipy.org/doc/numpy-1.9.1' }, 'examples_dirs': [], 'gallery_dirs': [], 'subsection_order': ExplicitOrder([]), 'find_mayavi_figures': False, 'filename_pattern': '.py', 'expected_failing_examples': [] } # Napoleon settings napoleon_use_ivar = True napoleon_use_param = True # Required for compatibility with sphinx-autodoc-typehints # linkcheck settings import multiprocessing linkcheck_ignore = [r'http[s]://apache-mxnet.s3*'] linkcheck_retries = 3 linkcheck_workers = int(multiprocessing.cpu_count() / 2)
# path where to save gallery generated examples 'gallery_dirs': 'auto_examples', 'backreferences_dir': 'api', 'reference_url': {'skimage': None}, 'image_scrapers': image_scrapers, # Default thumbnail size (400, 280) # Default CSS rescales (160, 112) # Size is decreased to reduce webpage loading time 'thumbnail_size': (280, 196), 'subsection_order': ExplicitOrder([ '../examples/data', '../examples/numpy_operations', '../examples/color_exposure', '../examples/edges', '../examples/transform', '../examples/registration', '../examples/filters', '../examples/features_detection', '../examples/segmentation', '../examples/applications', '../examples/developers', ]), 'binder': { # Required keys 'org': 'scikit-image', 'repo': 'scikit-image', 'branch': binder_branch, # Can be any branch, tag, or commit hash 'binderhub_url': 'https://mybinder.org', # Any URL of a binderhub. 'dependencies': '../../.binder/requirements.txt', # Optional keys 'use_jupyter_lab': False
intersphinx_mapping = { 'python': ('https://docs.python.org/{.major}'.format(sys.version_info), None), 'mxnet': ('https://mxnet.apache.org/', None), 'numpy': ('http://docs.scipy.org/doc/numpy/', None), 'scipy': ('http://docs.scipy.org/doc/scipy/reference', None), 'matplotlib': ('http://matplotlib.org/', None), 'nltk': ('http://www.nltk.org/', None), } from sphinx_gallery.sorting import ExplicitOrder examples_dirs = [] gallery_dirs = [] subsection_order = ExplicitOrder([]) def generate_doxygen_xml(app): """Run the doxygen make commands if we're on the ReadTheDocs server""" run_doxygen('..') def setup(app): # Add hook for building doxygen xml when needed # no c++ API for now app.connect("builder-inited", generate_doxygen_xml) app.add_config_value('recommonmark_config', { 'url_resolver': lambda url: github_doc_root + url, 'auto_doc_ref': True }, True)
'reference_url': dict(mne=None), 'examples_dirs': examples_dirs, 'subsection_order': ExplicitOrder(['../examples/io/', '../examples/simulation/', '../examples/preprocessing/', '../examples/visualization/', '../examples/time_frequency/', '../examples/stats/', '../examples/decoding/', '../examples/connectivity/', '../examples/forward/', '../examples/inverse/', '../examples/realtime/', '../examples/datasets/', '../tutorials/intro/', '../tutorials/io/', '../tutorials/raw/', '../tutorials/preprocessing/', '../tutorials/epochs/', '../tutorials/evoked/', '../tutorials/time-freq/', '../tutorials/source-modeling/', '../tutorials/stats-sensor-space/', '../tutorials/stats-source-space/', '../tutorials/machine-learning/', '../tutorials/simulation/', '../tutorials/sample-datasets/', '../tutorials/discussions/', '../tutorials/misc/']), 'gallery_dirs': gallery_dirs, 'default_thumb_file': os.path.join('_static', 'mne_helmet.png'),
sphinx_gallery_conf = { "examples_dirs": path.join(PROJECT_ROOT, "examples"), "gallery_dirs": path.join("galleries", "examples"), "filename_pattern": os.sep + "example_", "line_numbers": True, "remove_config_comments": True, "plot_gallery": plot_gallery, "subsection_order": ExplicitOrder([ path.join("..", "..", "examples", sub_gallery) for sub_gallery in ("beginner", "advanced") ]), "within_subsection_order": PysticheExampleTitleSortKey, "show_memory": show_cuda_memory if torch.cuda.is_available() else True, } # Remove matplotlib agg warnings from generated doc when using plt.show warnings.filterwarnings( "ignore", category=UserWarning, message= ("Matplotlib is currently using agg, which is a non-GUI backend, so cannot show " "the figure."), )
except ImportError: print("RTD theme not installed, using default") html_theme = 'alabaster' # 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'] from sphinx_gallery.sorting import ExplicitOrder from sphinx_gallery.sorting import FileNameSortKey # for sphinx gallery plugin sphinx_gallery_conf = { 'examples_dirs': ['../examples/getting_started', '../examples/modules'], # path to your example scripts 'gallery_dirs': ['getting_started', 'modules', 'usage', 'contribute'], # path where to save gallery generated examples 'subsection_order': ExplicitOrder([ '../examples/modules/extractors/', '../examples/modules/toolkit', '../examples/modules/sorters', '../examples/modules/comparison', '../examples/modules/widgets', ]), 'within_subsection_order': FileNameSortKey, }
# Turn on sphinx.ext.autosummary autosummary_generate = True # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # Configuration of the Sphinx-Gallery # ---------------------------------------------------------------------- from sphinx_gallery.sorting import ExplicitOrder sphinx_gallery_conf = { 'filename_pattern': 'ex_', 'examples_dirs': '../../examples', # path to your example scripts 'gallery_dirs': 'auto_examples', # path to where to save gallery generated output 'remove_config_comments': True, 'download_all_examples': False, 'subsection_order': ExplicitOrder(['../../examples/basic', '../../examples/advanced', '../../examples/other']), } # Configuration of Sphinx-CopyButton # ---------------------------------------------------------------------- copybutton_prompt_text = ">>> " # Configuration of Latex-to-SVG # ---------------------------------------------------------------------- # Render Latex math equations as svg instead of rendering with JavaScript imgmath_image_format = 'png' if os.name=='nt' else 'svg' imgmath_dvisvgm = 'dvisvgm' imgmath_latex_preamble = r'''