Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: enable local sphinx builds #345

Merged
merged 16 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -414,3 +414,4 @@ TSWLatexianTemp*

# exclude notebooks directory: this is generated during build
/notebooks/
/sphinx/base/
4 changes: 4 additions & 0 deletions .idea/facet.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions sphinx/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
base
source/_generated
source/apidoc
34 changes: 14 additions & 20 deletions sphinx/make.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
#!/usr/bin/env python3
"""
Make sphinx documentation using the makefile in pytools
Make sphinx documentation using the pytools make utility
"""

import os
import sys
from urllib import request

BRANCH = "2.0.x"

def make() -> None:
"""
Run the common make file available in the pytools repo
"""
cwd = os.path.dirname(os.path.realpath(__file__))
os.chdir(cwd)

sys.path.insert(
0,
os.path.normpath(
os.path.join(cwd, os.pardir, os.pardir, "pytools", "sphinx", "base")
),
)
# noinspection PyUnresolvedReferences
from make_base import make
if __name__ == "__main__":

make(modules=["pytools", "sklearndf", "facet"])
# noinspection PyUnusedLocal
def run_make(branch: str, working_directory: str) -> None:
"""Stub, overwritten by bootstrap.py"""

# run the common make file available in the pytools repo
with request.urlopen(
f"https://raw.githubusercontent.com/BCG-Gamma/pytools/{BRANCH}"
f"/sphinx/base/bootstrap.py"
) as response:
exec(response.read().decode("utf-8"), globals())

if __name__ == "__main__":
make()
run_make(branch=BRANCH, working_directory=os.path.dirname(__file__))
3 changes: 0 additions & 3 deletions sphinx/source/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions sphinx/source/_templates/autosummary.rst

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The figure below provides a high level overview of the workflow when using FACET, and
for each step in the workflow, a brief description.

.. image:: ../_static/Facet_flow.svg
.. image:: _static/Facet_flow.svg
:width: 550

Please refer to the :ref:`tutorials<tutorials>` for examples of using FACET classes
Expand Down
26 changes: 9 additions & 17 deletions sphinx/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,20 @@
import os
import sys

sys.path.insert(
0,
os.path.abspath(
os.path.join(
os.path.dirname(__file__),
os.pardir,
os.pardir,
os.pardir,
"pytools",
"sphinx",
"base",
)
),
)
_dir_base = os.path.join(os.path.dirname(os.path.dirname(__file__)), "base")
sys.path.insert(0, _dir_base)

from conf_base import set_config

# ----- custom configuration -----
# ----- set custom configuration -----

set_config(
globals(),
project="facet",
modules=["facet", "pytools", "sklearndf"],
html_logo="_static/Gamma_Facet_Logo_RGB_LB.svg",
html_logo=os.path.join("_static", "Gamma_Facet_Logo_RGB_LB.svg"),
intersphinx_mapping={
"pytools": ("https://bcg-gamma.github.io/pytools/", None),
"shap": ("https://shap.readthedocs.io/en/stable", None),
"sklearndf": ("https://bcg-gamma.github.io/sklearndf/", None),
},
)
Loading