<commit_before># -*- coding: utf-8 -*-
#
# This file is execfile()d with the current directory set to its containing dir.

# To run the docs build directly, generate module index:
#   rm -r docs/api ; sphinx-apidoc -f -M -o docs/api smif
# Then build docs:
#   rm -r docs/_build ; sphinx-build -b html docs docs/_build/html

# 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.

# -- Hack for ReadTheDocs and apidoc options -----------------------------------
# This hack is necessary since RTD does not issue `sphinx-apidoc` before running
# If extensions (or modules to document with autodoc) are in another directory,
# DON'T FORGET: Check the box "Install your project inside a virtualenv using
# setup.py install" in the RTD Advanced Settings.
# `sphinx-build -b html . _build/html`. See Issue:
# https://github.com/rtfd/readthedocs.org/issues/1139

# It also appears necessary in order to pass options to sphinx-apidoc which obr
# or setuptools don't currently allow. See issue:
# https://github.com/sphinx-doc/sphinx/issues/1861

import inspect
import os
import sys
from unittest.mock import MagicMock

import better_apidoc

# 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('.'))
__location__ = os.path.join(os.getcwd(), os.path.dirname(
    inspect.getfile(inspect.currentframe())))

# 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.join(__location__, '../src'))


class Mock(MagicMock):
    @classmethod
    def __getattr__(cls, name):
        return MagicMock()


# mock modules which we can avoid installing for docs-building
mock_modules = [
    'fiona',
    'rtree',
    'shapely',
    'shapely.geometry',
    'shapely.validation',
    'pandas',
    'xarray'
]
sys.modules.update((mod_name, Mock()) for mod_name in mock_modules)

output_dir = os.path.join(__location__, "api")
module_dir = os.path.join(__location__, "../src/smif")
templates_dir = os.path.join(__location__, "_templates")

better_apidoc.main([
    'better-apidoc',
    '-t',
    templates_dir,
    '--force',
    '--separate',
    '-o',
    output_dir,
    module_dir
])

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


# Extra styles, found in _static
def setup(app):
    app.add_stylesheet('theme_tweaks.css')


# If your documentation needs a minimal Sphinx version, state it here.
# needs_sphinx = '1.0'<commit_msg>Mock pandas.core for RTD<commit_after># -*- coding: utf-8 -*-
#
# This file is execfile()d with the current directory set to its containing dir.

# To run the docs build directly, generate module index:
#   rm -r docs/api ; sphinx-apidoc -f -M -o docs/api smif
# Then build docs:
#   rm -r docs/_build ; sphinx-build -b html docs docs/_build/html

# 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.

# -- Hack for ReadTheDocs and apidoc options -----------------------------------
# This hack is necessary since RTD does not issue `sphinx-apidoc` before running
# If extensions (or modules to document with autodoc) are in another directory,
# DON'T FORGET: Check the box "Install your project inside a virtualenv using
# setup.py install" in the RTD Advanced Settings.
# `sphinx-build -b html . _build/html`. See Issue:
# https://github.com/rtfd/readthedocs.org/issues/1139

# It also appears necessary in order to pass options to sphinx-apidoc which obr
# or setuptools don't currently allow. See issue:
# https://github.com/sphinx-doc/sphinx/issues/1861

import inspect
import os
import sys
from unittest.mock import MagicMock

import better_apidoc

# 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('.'))
__location__ = os.path.join(os.getcwd(), os.path.dirname(
    inspect.getfile(inspect.currentframe())))

# 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.join(__location__, '../src'))


class Mock(MagicMock):
    @classmethod
    def __getattr__(cls, name):
        return MagicMock()


# mock modules which we can avoid installing for docs-building
mock_modules = [
    'fiona',
    'rtree',
    'shapely',
    'shapely.geometry',
    'shapely.validation',
    'pandas',
    'pandas.core',
    'xarray'
]
sys.modules.update((mod_name, Mock()) for mod_name in mock_modules)

output_dir = os.path.join(__location__, "api")
module_dir = os.path.join(__location__, "../src/smif")
templates_dir = os.path.join(__location__, "_templates")

better_apidoc.main([
    'better-apidoc',
    '-t',
    templates_dir,
    '--force',
    '--separate',
    '-o',
    output_dir,
    module_dir
])

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


# Extra styles, found in _static
def setup(app):
    app.add_stylesheet('theme_tweaks.css')


# If your documentation needs a minimal Sphinx version, state it here.
# needs_sphinx = '1.0'
{'fraction_non_alphanumeric': 0.1354239663629993, 'fraction_numerical': 0.004555010511562719, 'mean_word_length': 3.315192743764172, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '5847210', 'n_tokens_mistral': 1789, 'n_tokens_neox': 1717, 'n_words': 611}