# 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. import os import sys from inicheck.tools import config_documentation # -- Have to do a mock install of some modules that RTD doesn't have -------- from unittest.mock import Mock from smrf.utils.utils import get_config_doc_section_hdr config_documentation('./auto_config.rst', modules='smrf', section_link_dict=get_config_doc_section_hdr()) if os.environ.get('READTHEDOCS') == 'True': sys.path.insert(0, os.path.abspath('.')) else: sys.path.insert(0, os.path.abspath('../')) # class Mock(MagicMock): # @classmethod # def __getattr__(cls, name): # return Mock() MOCK_MODULES = [ 'netCDF4', 'matplotlib', 'matplotlib.pyplot', 'pandas', 'pykrige' ]
# serve to show the default. from mock import Mock as MagicMock import sys import os from inicheck.tools import config_documentation # 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. #sys.path.insert(0, os.path.abspath('.')) # Call auto documentation for our config files config_documentation('./auto_config.rst', paths=['../awsm/framework/CoreConfig.ini', '../awsm/framework/recipes.ini']) # Get the project root dir, which is the parent dir of this if os.environ.get('READTHEDOCS') == 'True': sys.path.insert(0, os.path.abspath('.')) else: sys.path.insert(0, os.path.abspath('../')) # -- Have to do a mock install of some modules that RTD doesn't have -------- class Mock(MagicMock): @classmethod def __getattr__(cls, name): return Mock()
# 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. # import os import sys sys.path.insert(0, os.path.abspath('..')) import snowplot from inicheck.tools import config_documentation import datetime # Auto Document the config file. config_documentation('./auto_config.rst', modules='snowplot') # -- General configuration --------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix(es) of source filenames.