Skip to content

Commit

Permalink
Merge pull request #56 from pyt-team/frantzen/docs-github-link
Browse files Browse the repository at this point in the history
Tweaks to documentation
  • Loading branch information
ffl096 authored Oct 18, 2024
2 parents 80acf21 + 8c83d04 commit 122b56f
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 87 deletions.
4 changes: 4 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Our Code of Conduct is at
https://pyt-team.github.io/toponetx/project/code_of_conduct.html.

The code of conduct lives in the TopoNetX repository under `docs/project/code_of_conduct.rst`.
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,12 @@ import topoembedx as tex
import toponetx as tnx
# create a cell complex object with a few cells
cc = tnx.classes.CellComplex([[1, 2, 3, 4], [3, 4, 5, 6, 7, 8]],ranks=2)
cc = tnx.CellComplex([[1, 2, 3, 4], [3, 4, 5, 6, 7, 8]], ranks=2)
# create a model
model = tex.Cell2Vec()
# fit the model
model.fit(cc, neighborhood_type="adj", neighborhood_dim={"rank": 1, "via_rank": -1})
# here neighborhood_dim={"rank": 1, "via_rank": -1} specifies the dimension for
# which the cell embeddings are going to be computed.
Expand All @@ -106,9 +104,7 @@ model.fit(cc, neighborhood_type="adj", neighborhood_dim={"rank": 1, "via_rank":
# get the embeddings:
embeddings = model.get_embedding()
```

## 🔍 References ##
Expand Down Expand Up @@ -147,4 +143,3 @@ Figure from:
Partially funded by the European Union (ERC, HIGH-HOPeS, 101039827). Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council Executive Agency. Neither the European Union nor the granting authority can be held responsible for them.
Partially funded by the National Science Foundation (DMS-2134231, DMS-2134241).
Binary file added docs/_static/favicon-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
111 changes: 44 additions & 67 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,102 +1,79 @@
"""Sphinx configuration file."""

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

project = "TopoEmbedX"
copyright = "2022-2023, PyT-Team, Inc."
author = "PyT-Team Authors"
language = "en"

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

extensions = [
"nbsphinx",
"nbsphinx_link",
"numpydoc",
"sphinx.ext.autodoc",
"sphinx.ext.coverage",
"sphinx.ext.doctest",
"sphinx.ext.githubpages",
"sphinx.ext.intersphinx",
"sphinx.ext.mathjax",
"sphinx.ext.viewcode",
"sphinx_copybutton",
"sphinx_gallery.load_style",
]

templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "**.ipynb_checkpoints"]

intersphinx_mapping = {
"networkx": ("https://networkx.org/documentation/stable/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"python": ("https://docs.python.org/3/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
"toponetx": ("https://pyt-team.github.io/toponetx/", None),
}

# Configure nbsphinx for notebook execution
nbsphinx_execute_arguments = [
"--InlineBackend.figure_formats={'svg', 'pdf'}",
"--InlineBackend.rc={'figure.dpi': 96}",
]

nbsphinx_execute = "never"

# To get a prompt similar to the Classic Notebook, use
nbsphinx_input_prompt = " In [%s]:"
nbsphinx_output_prompt = " Out [%s]:"

nbsphinx_allow_errors = True

templates_path = ["_templates"]

source_suffix = [".rst"]

master_doc = "index"

language = "en"

nbsphinx_prolog = r"""
{% set docname = env.doc2path(env.docname, base=None) %}
.. raw:: latex
\nbsphinxstartnotebook{\scriptsize\noindent\strut
\textcolor{gray}{The following section was generated from
\sphinxcode{\sphinxupquote{\strut {{ docname | escape_latex }}}} \dotfill}}
"""
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "**.ipynb_checkpoints"]

pygments_style = None
# -- Options for HTML output -------------------------------------------------

html_theme = "pydata_sphinx_theme"
html_baseurl = "pyt-team.github.io"
htmlhelp_basename = "pyt-teamdoc"
html_last_updated_fmt = "%c"
html_baseurl = "https://pyt-team.github.io/topoembedx/"

latex_elements = {}
html_context = {
"github_user": "pyt-team",
"github_repo": "TopoEmbedX",
"github_version": "main",
"doc_path": "docs",
}

html_theme_options = {
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/pyt-team/TopoEmbedX",
"icon": "fa-brands fa-github",
"type": "fontawesome",
}
],
"use_edit_page_button": True,
}

latex_documents = [
(
master_doc,
"topoembedx.tex",
"TopoEmbedX Documentation",
"PyT-Team",
"manual",
),
]
html_favicon = "_static/favicon-48.png"

man_pages = [(master_doc, "topoembedx", "TopoEmbedX Documentation", [author], 1)]

texinfo_documents = [
(
master_doc,
"topoembedx",
"TopoEmbedX Documentation",
author,
"topoembedx",
"One line description of project.",
"Miscellaneous",
),
]
html_show_sourcelink = False

epub_title = project
epub_exclude_files = ["search.html"]
# Exclude copy button from appearing over notebook cell numbers by using :not()
# The default copybutton selector is `div.highlight pre`
# https://github.com/executablebooks/sphinx-copybutton/blob/master/sphinx_copybutton/__init__.py#L82
copybutton_selector = ":not(.prompt) > div.highlight pre"

# configure intersphinx
intersphinx_mapping = {
"networkx": ("https://networkx.org/documentation/stable/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"python": ("https://docs.python.org/3/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
"toponetx": ("https://pyt-team.github.io/toponetx/", None),
}
# -- Options for EPUB output -------------------------------------------------

# configure numpydoc
numpydoc_validation_checks = {"all", "GL01", "ES01", "SA01", "EX01"}
numpydoc_show_class_members = False
numpydoc_class_members_toctree = False
epub_exclude_files = ["search.html"]
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ doc = [
"nbsphinx_link",
"numpydoc >= 1.8.0",
"sphinx",
"sphinx-copybutton",
"sphinx_gallery",
"pydata-sphinx-theme"
]
Expand Down
28 changes: 14 additions & 14 deletions test/test_tutorials.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@


def _exec_tutorial(path):
file_name = tempfile.NamedTemporaryFile(suffix=".ipynb").name
args = [
"jupyter",
"nbconvert",
"--to",
"notebook",
"--execute",
"--ExecutePreprocessor.timeout=1000",
"--ExecutePreprocessor.kernel_name=python3",
"--output",
file_name,
path,
]
subprocess.check_call(args)
with tempfile.NamedTemporaryFile(suffix=".ipynb") as tmp_file:
args = [
"jupyter",
"nbconvert",
"--to",
"notebook",
"--execute",
"--ExecutePreprocessor.timeout=1000",
"--ExecutePreprocessor.kernel_name=python3",
"--output",
tmp_file.name,
path,
]
subprocess.check_call(args)


TUTORIALS_DIR = "tutorials"
Expand Down

0 comments on commit 122b56f

Please sign in to comment.