<commit_before>#  Copyright (c) 2015 - 2022, Intel Corporation
#  SPDX-License-Identifier: BSD-3-Clause
#

# -- Path setup --------------------------------------------------------------

# 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
import glob
import sphinx_rtd_theme

_docs_dir = os.path.dirname(__file__)
_repo_dir = os.path.abspath(os.path.join(_docs_dir, '..', '..', '..'))
_ext_dir = os.path.join(_docs_dir, '_ext')
_geopmdpy_dir = os.path.join(_repo_dir, 'service')
_geopmpy_dir = os.path.join(_repo_dir, 'scripts')
sys.path.insert(0, _geopmdpy_dir)
sys.path.insert(0, _geopmpy_dir)
sys.path.append(_ext_dir)

# -- Project information -----------------------------------------------------

project = 'GEOPM'
copyright = '2015 - 2022, Intel Corporation. All rights reserved.'

author = 'Intel (R) Corporation'

# -- Helper functions --------------------------------------------------------

# gets the description of the man page from the rst file
def get_description(rst_file_name):
    previous_line = ""
    current_line = ""
    with open(rst_file_name, 'r') as rst_file:
        # loop through each line of text
        for line in rst_file:
            line = line.rstrip()
            previous_line = current_line
            current_line = line
            # if you find the starting header
            if (current_line and current_line == len(current_line) * '='):
                rst_file.close()
                return previous_line.split(" -- ")[1]
    # if you get to the end of the file without finding the starting header
    rst_file.close()
    return rst_file_name.split('.')[0].replace('_', ' ')

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
master_doc = 'index'

extensions = [
    'sphinx.ext.napoleon',
    'sphinx_rtd_theme',
    'sphinx.ext.autosectionlabel',
    'sphinxemoji.sphinxemoji',
    'sphinx.ext.intersphinx',
    'sphinx.ext.todo',
    'geopmlint',
    'geopm_rst_extensions',
]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

napoleon_google_docstring = True

autodoc_mock_imports = ['geopmdpy.gffi']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

autosectionlabel_prefix_document = True

# Fail the documentation build for nitpicky things like broken cross-references.
nitpicky = True

intersphinx_mapping = {
    'python': ('https://docs.python.org/3', None),
    'dasbus': ('https://dasbus.readthedocs.io/en/stable', None),
    'pygobject': ('https://pygobject.readthedocs.io/en/latest', None),
    'cffi': ('https://cffi.readthedocs.io/en/latest', None),
    'pandas': ('https://pandas.pydata.org/docs/', None),<commit_msg>Fix issue where pandas is required for docs<commit_after>#  Copyright (c) 2015 - 2022, Intel Corporation
#  SPDX-License-Identifier: BSD-3-Clause
#

# -- Path setup --------------------------------------------------------------

# 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
import glob
import sphinx_rtd_theme

_docs_dir = os.path.dirname(__file__)
_repo_dir = os.path.abspath(os.path.join(_docs_dir, '..', '..', '..'))
_ext_dir = os.path.join(_docs_dir, '_ext')
_geopmdpy_dir = os.path.join(_repo_dir, 'service')
_geopmpy_dir = os.path.join(_repo_dir, 'scripts')
sys.path.insert(0, _geopmdpy_dir)
sys.path.insert(0, _geopmpy_dir)
sys.path.append(_ext_dir)

# -- Project information -----------------------------------------------------

project = 'GEOPM'
copyright = '2015 - 2022, Intel Corporation. All rights reserved.'

author = 'Intel (R) Corporation'

# -- Helper functions --------------------------------------------------------

# gets the description of the man page from the rst file
def get_description(rst_file_name):
    previous_line = ""
    current_line = ""
    with open(rst_file_name, 'r') as rst_file:
        # loop through each line of text
        for line in rst_file:
            line = line.rstrip()
            previous_line = current_line
            current_line = line
            # if you find the starting header
            if (current_line and current_line == len(current_line) * '='):
                rst_file.close()
                return previous_line.split(" -- ")[1]
    # if you get to the end of the file without finding the starting header
    rst_file.close()
    return rst_file_name.split('.')[0].replace('_', ' ')

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
master_doc = 'index'

extensions = [
    'sphinx.ext.napoleon',
    'sphinx_rtd_theme',
    'sphinx.ext.autosectionlabel',
    'sphinxemoji.sphinxemoji',
    'sphinx.ext.intersphinx',
    'sphinx.ext.todo',
    'geopmlint',
    'geopm_rst_extensions',
]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

napoleon_google_docstring = True

autodoc_mock_imports = ['geopmdpy.gffi',
                        'pandas']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

autosectionlabel_prefix_document = True

# Fail the documentation build for nitpicky things like broken cross-references.
nitpicky = True

intersphinx_mapping = {
    'python': ('https://docs.python.org/3', None),
    'dasbus': ('https://dasbus.readthedocs.io/en/stable', None),
    'pygobject': ('https://pygobject.readthedocs.io/en/latest', None),
    'cffi': ('https://cffi.readthedocs.io/en/latest', None),
    'pandas': ('https://pandas.pydata.org/docs/', None),
{'fraction_non_alphanumeric': 0.18619709412507895, 'fraction_numerical': 0.006948831332912192, 'mean_word_length': 2.612664004563605, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '93270', 'n_tokens_mistral': 2034, 'n_tokens_neox': 1960, 'n_words': 529}