Skip to content

Commit 3a33df5

Browse files
committed
Publish 0.2.0; fix docs
1 parent cd7b481 commit 3a33df5

File tree

8 files changed

+1594
-3
lines changed

8 files changed

+1594
-3
lines changed

bliss/api.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import base64
22
from pathlib import Path
3-
from typing import Dict, Literal, Optional, Tuple
3+
from typing import Dict, Literal, Optional, Tuple, TypeAlias
44

55
import requests
66
import torch
@@ -17,10 +17,12 @@
1717
from bliss.surveys import sdss_download
1818
from bliss.train import train as _train
1919

20-
SurveyType = Literal["decals", "hst", "lsst", "sdss"]
20+
SurveyType: TypeAlias = Literal["decals", "hst", "lsst", "sdss"]
2121

2222

2323
class BlissClient:
24+
"""Client for interacting with the BLISS API."""
25+
2426
def __init__(self, cwd: str):
2527
self._cwd = cwd
2628
# cached_data_path (str): Path to directory where cached data will be stored.

docs/docsrc/conf.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,35 @@
6666
# relative to this directory. They are copied after the builtin static files,
6767
# so a file named "default.css" will overwrite the builtin "default.css".
6868
html_static_path = ["_static"]
69+
70+
# For nbsphinx
71+
nbsphinx_execute = "never"
72+
73+
# Below code is necessary to ensure pandoc is available for use by nbsphinx.
74+
# See https://stackoverflow.com/questions/62398231/building-docs-fails-due-to-missing-pandoc/71585691#71585691 # noqa: E501 # pylint: disable=line-too-long
75+
from inspect import getsourcefile # noqa: E402 # pylint: disable=wrong-import-position
76+
77+
# Get path to directory containing this file, conf.py.
78+
PATH_OF_THIS_FILE = getsourcefile(lambda: 0) # noqa: WPS522
79+
DOCS_DIRECTORY = os.path.dirname(os.path.abspath(PATH_OF_THIS_FILE)) # type: ignore
80+
81+
82+
def ensure_pandoc_installed(_):
83+
import pypandoc # pylint: disable=import-outside-toplevel
84+
85+
# Download pandoc if necessary. If pandoc is already installed and on
86+
# the PATH, the installed version will be used. Otherwise, we will
87+
# download a copy of pandoc into docs/bin/ and add that to our PATH.
88+
pandoc_dir = os.path.join(DOCS_DIRECTORY, "bin")
89+
# Add dir containing pandoc binary to the PATH environment variable
90+
if pandoc_dir not in os.environ["PATH"].split(os.pathsep):
91+
os.environ["PATH"] += os.pathsep + pandoc_dir
92+
pypandoc.ensure_pandoc_installed(
93+
version="2.11.4",
94+
targetfolder=pandoc_dir,
95+
delete_installer=True,
96+
)
97+
98+
99+
def setup(app):
100+
app.connect("builder-inited", ensure_pandoc_installed)

docs/docsrc/tutorials/index.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Tutorials
2+
=========
3+
4+
.. toctree::
5+
notebooks/tutorial
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:3f9230ff450904e505d787169070409274a359b8cbd97f86d738ef7e87eefc6a
3+
size 14400

docs/docsrc/tutorials/notebooks/predict.html

Lines changed: 60 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)