Files
PINA/docs/source/conf.py
Filippo Olivo 4177bfbb50 Fix Codacy Warnings (#477)
---------

Co-authored-by: Dario Coscia <dariocos99@gmail.com>
2025-03-19 17:48:18 +01:00

249 lines
7.8 KiB
Python

# -*- coding: utf-8 -*-
#
# PINA documentation build configuration file, created by
# sphinx-quickstart on Mon Jun 22 16:09:40 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys
import os
import sphinx_rtd_theme
import importlib.metadata
# -- Project information -----------------------------------------------------
_DISTRIBUTION_METADATA = importlib.metadata.metadata('pina-mathlab')
project = _DISTRIBUTION_METADATA['Name']
copyright = _DISTRIBUTION_METADATA['License-File']
author = "PINA contributors"
version = _DISTRIBUTION_METADATA['Version']
sys.path.insert(0, os.path.abspath('../sphinx_extensions')) # extension to remove paramref link from lightinig
# -- General configuration ------------------------------------------------
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.doctest',
'sphinx.ext.napoleon',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
'sphinx.ext.mathjax',
'sphinx.ext.intersphinx',
'paramref_extension', # this extension is made to remove paramref links from lightining doc
'sphinx_copybutton',
'sphinx_design'
]
# The root document.
root_doc = 'index'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'docstrings', 'nextgen', 'Thumbs.db', '.DS_Store']
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = 'literal'
# Generate the API documentation when building
autosummary_generate = True
numpydoc_show_class_members = False
intersphinx_mapping = {
'python': ('http://docs.python.org/3', None),
'matplotlib': ('https://matplotlib.org/stable', None),
'torch': ('https://pytorch.org/docs/stable/', None),
'lightning.pytorch': ("https://lightning.ai/docs/pytorch/stable/", None),
}
nitpicky = True
nitpick_ignore = [
# ('py:meth', 'lightning.pytorch.core.module.LightningModule.log'),
# ('py:meth', 'lightning.pytorch.core.module.LightningModule.log_dict'),
# ('py:exc', 'MisconfigurationException'),
# ('py:func', 'torch.inference_mode'),
# ('py:func', 'torch.no_grad'),
# ('py:class', 'torch.utils.data.DistributedSampler'),
# ('py:class', 'pina.model.layers.convolution.BaseContinuousConv'),
# ('py:class', 'Module'),
# ('py:class', 'torch.nn.modules.loss._Loss'), # TO FIX
# ('py:class', 'torch.optim.LRScheduler'), # TO FIX
]
# Add any paths that contain templates here, relative to this directory.
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'
# The master toctree document.
master_doc = 'index'
# autoclass
autoclass_content = 'both'
# 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.
release = version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = []
# If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
add_module_names = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sortins as "systems = False
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
# -- Options for viewcode extension ---------------------------------------
# Follow alias objects that are imported from another module such as functions,
# classes and attributes. As side effects, this option ... ???
# If false, ... ???.
# The default is True.
viewcode_import = True
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'pydata_sphinx_theme'
# 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
# documentation.
# html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
html_logo = "index_files/PINA_logo.png"
html_theme_options = {
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/mathLab/PINA",
"icon": "fab fa-github",
"type": "fontawesome",
},
{
"name": "Twitter",
"url": "https://x.com/pina_mathlab?s=21",
"icon": "fab fa-twitter",
"type": "fontawesome",
},
{
"name": "Email",
"url": "mailto:pina.mathlab@gmail.com",
"icon": "fas fa-envelope",
"type": "fontawesome",
},
],
"show_prev_next": False,
"navbar_start": ["navbar-logo"],
"navbar_end": ["navbar-icon-links"],
"header_links_before_dropdown": 8,
}
# If not ''i, a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
html_last_updated_fmt = '%b %d, %Y'
# If false, no index is generated.
html_use_index = True
# If true, links to the reST sources are added to the pages.
html_show_sourcelink = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
html_show_copyright = True
# Output file base name for HTML help builder.
htmlhelp_basename = 'pinadoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
'papersize': 'a4paper',
# The font size ('10pt', '11pt' or '12pt').
'pointsize': '20pt',
# Additional stuff for the LaTeX preamble.
'preamble': '',
# Latex figure (float) alignment
'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'pina.tex', u'PINA Documentation',
u'PINA contributors', '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, 'pina', u'PINA Documentation',
[author], 1)
]
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'pina', u'PINA Documentation',
author, 'pina', 'One line description of project.',
'Miscellaneous'),
]
# If true, do not generate a @detailmenu in the "Top" node's menu.
# texinfo_no_detailmenu = False
autodoc_member_order = 'bysource'