# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- 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, sys
from distutils.version import LooseVersion

# sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath("../.."))
import graphistry

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

project = "PyGraphistry"
copyright = "2021, Graphistry, Inc."
author = "Graphistry, Inc."

# The full version, including alpha/beta/rc tags
version = LooseVersion(graphistry.__version__).vstring
relesae = version

# -- 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.
extensions = [
    "sphinx.ext.autodoc",
    #'sphinx.ext.autosummary',
    #'sphinx.ext.intersphinx',
    "sphinx.ext.ifconfig",
    "sphinx_autodoc_typehints"
]


#FIXME Why is sphinx/autodoc failing here?
nitpick_ignore = [
    ('py:class', '1'),  # Ex: api : Optional[Literal[1, 3]]
    ('py:class', '3'),
    ('py:class', "<class 'dict'>"),
    ('py:class', "<class 'str'>"),
    ('py:class', 'graphistry.Engine.Engine'),
    ('py:class', 'graphistry.gremlin.CosmosMixin'),
    ('py:class', 'graphistry.gremlin.GremlinMixin'),
    ('py:class', 'graphistry.gremlin.NeptuneMixin'),
    ('py:class', 'graphistry.layouts.LayoutsMixin'),
    ('py:class', 'graphistry.compute.ComputeMixin'),
    ('py:class', 'graphistry.compute.conditional.ConditionalMixin'),
    ('py:class', 'graphistry.compute.cluster.ClusterMixin'),
    ('py:class', 'graphistry.Plottable.Plottable'),
    ('py:class', 'graphistry.plugins.cugraph.compute_cugraph'),
    ('py:class', 'graphistry.plugins.cugraph.from_cugraph'),
    ('py:class', 'graphistry.plugins.igraph.compute_igraph'),
    ('py:class', 'graphistry.plugins.igraph.from_igraph'),
    ('py:class', 'graphistry.plugins.igraph.layout_igraph'),
    ('py:class', 'graphistry.feature_utils.FeatureMixin'),
    ('py:class', 'graphistry.dgl_utils.DGLGraphMixin'),
    ('py:class', 'graphistry.umap_utils.UMAPMixin'),
    ('py:class', 'graphistry.text_utils.SearchToGraphMixin'),
    ('py:class', 'graphistry.embed_utils.HeterographEmbedModuleMixin'),
    ('py:class', 'graphistry.PlotterBase.PlotterBase'),
    ('py:class', 'graphistry.compute.ast.ASTObject'),
    ('py:class', 'Plotter'),
    ('py:class', 'Plottable'),
    ('py:class', 'CuGraphKind'),
    ('py:class', 'cugraph.Graph'),
    ('py:class', 'IGraph graph'),
    ('py:class', 'igraph'),
    ('py:class', 'dgl'),
    ('py:class', 'matplotlib'),
    ('py:class', 'torch'),
    ('py:class', 'umap'),
    ('py:class', 'sentence_transformers'),
    ('py:class', 'dirty_cat'),
    ('py:class', 'sklearn'),
    ('py:class', 'scipy'),
    ('py:class', 'seaborn'),
    ('py:class', 'annoy'),
    ('py:class', 'NetworkX graph'),
    ('py:class', 'Pandas dataframe'),
    ('py:class', 'ArrowUploader'),
    ('py:class', 'json.encoder.JSONEncoder'),
    ('py:class', 'pandas.DataFrame'),
    ('py:class', 'pyarrow.lib.Table'),
    ('py:class', 'requests.models.Response'),
    ('py:class', 'weakref.WeakKeyDictionary'),
    ('py:data', 'typing.Any'),
    ('py:data', 'typing.List'),
    ('py:data', 'typing.Literal'),
    ('py:data', 'typing.Optional'),
    ('py:data', 'typing.Callable'),
    ('py:data', 'typing.Tuple'),
    ('py:data', 'typing.Union'),
    ('py:class', 'Mode'),
    ('py:class','pandas.core.frame.DataFrame'),
    ('py:class', 'graphistry.privacy.Privacy')
]

set_type_checking_flag = True
# typehints_fully_qualified=True
always_document_param_types = True
typehints_document_rtype = True

# 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 encoding of source files.
source_encoding = "utf-8-sig"

# The master toctree document.
master_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 = []

pygments_style = "sphinx"
todo_include_todos = False

# -- 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 = "sphinx_rtd_theme"

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

html_show_sphinx = False
html_show_sourcelink = False

htmlhelp_basename = "PyGraphistrydoc"


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
    # The paper size ('letterpaper' or 'a4paper').
    #'papersize': 'letterpaper',
    # The font size ('10pt', '11pt' or '12pt').
    #'pointsize': '10pt',
    # 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,
        "PyGraphistry.tex",
        u"PyGraphistry Documentation",
        u"Graphistry, Inc.",
        "manual",
    ),
]

# The name of an image file (relative to this directory) to place at the top of
# the title page.
# latex_logo = None

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
# latex_use_parts = False

# If true, show page references after internal links.
# latex_show_pagerefs = False

# If true, show URL addresses after external links.
# latex_show_urls = False

# Documents to append as an appendix to all manuals.
# latex_appendices = []

# If false, no module index is generated.
latex_domain_indices = False


# -- 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, "pygraphistry", u"PyGraphistry Documentation", [author], 1)]

# If true, show URL addresses after external links.
# man_show_urls = False


# -- 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,
        "PyGraphistry",
        u"PyGraphistry Documentation",
        author,
        "PyGraphistry",
        "One line description of project.",
        "Miscellaneous",
    ),
]

# Documents to append as an appendix to all manuals.
# texinfo_appendices = []

# If false, no module index is generated.
texinfo_domain_indices = False

# How to display URL addresses: 'footnote', 'no', or 'inline'.
# texinfo_show_urls = 'footnote'

# If true, do not generate a @detailmenu in the "Top" node's menu.
# texinfo_no_detailmenu = False


# -- Options for Epub output ----------------------------------------------

# Bibliographic Dublin Core info.
epub_title = project
epub_author = author
epub_publisher = author
epub_copyright = copyright

# The basename for the epub file. It defaults to the project name.
# epub_basename = project

# The HTML theme for the epub output. Since the default themes are not optimized
# for small screen space, using the same theme for HTML and epub output is
# usually not wise. This defaults to 'epub', a theme designed to save visual
# space.
# epub_theme = 'epub'

# The language of the text. It defaults to the language option
# or 'en' if the language is not set.
# epub_language = ''

# The scheme of the identifier. Typical schemes are ISBN or URL.
# epub_scheme = ''

# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
# epub_identifier = ''

# A unique identification for the text.
# epub_uid = ''

# A tuple containing the cover image and cover page html template filenames.
# epub_cover = ()

# A sequence of (type, uri, title) tuples for the guide element of content.opf.
# epub_guide = ()

# HTML files that should be inserted before the pages created by sphinx.
# The format is a list of tuples containing the path and title.
# epub_pre_files = []

# HTML files shat should be inserted after the pages created by sphinx.
# The format is a list of tuples containing the path and title.
# epub_post_files = []

# A list of files that should not be packed into the epub file.
epub_exclude_files = ["search.html"]

# The depth of the table of contents in toc.ncx.
# epub_tocdepth = 3

# Allow duplicate toc entries.
# epub_tocdup = True

# Choose between 'default' and 'includehidden'.
# epub_tocscope = 'default'

# Fix unsupported image types using the Pillow.
# epub_fix_images = False

# Scale large images.
# epub_max_image_width = 0

# How to display URL addresses: 'footnote', 'no', or 'inline'.
# epub_show_urls = 'inline'

# If false, no index is generated.
# epub_use_index = True


# Example configuration for intersphinx: refer to the Python standard library.
# intersphinx_mapping = {'https://docs.python.org/': None}
