Skip to content

Commit

Permalink
Publish 0.2.0; fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zhixiangteoh committed Jun 13, 2023
1 parent cd7b481 commit 3a33df5
Show file tree
Hide file tree
Showing 8 changed files with 1,594 additions and 3 deletions.
6 changes: 4 additions & 2 deletions bliss/api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import base64
from pathlib import Path
from typing import Dict, Literal, Optional, Tuple
from typing import Dict, Literal, Optional, Tuple, TypeAlias

import requests
import torch
Expand All @@ -17,10 +17,12 @@
from bliss.surveys import sdss_download
from bliss.train import train as _train

SurveyType = Literal["decals", "hst", "lsst", "sdss"]
SurveyType: TypeAlias = Literal["decals", "hst", "lsst", "sdss"]


class BlissClient:
"""Client for interacting with the BLISS API."""

def __init__(self, cwd: str):
self._cwd = cwd
# cached_data_path (str): Path to directory where cached data will be stored.
Expand Down
32 changes: 32 additions & 0 deletions docs/docsrc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,35 @@
# 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"]

# For nbsphinx
nbsphinx_execute = "never"

# Below code is necessary to ensure pandoc is available for use by nbsphinx.
# See https://stackoverflow.com/questions/62398231/building-docs-fails-due-to-missing-pandoc/71585691#71585691 # noqa: E501 # pylint: disable=line-too-long
from inspect import getsourcefile # noqa: E402 # pylint: disable=wrong-import-position

# Get path to directory containing this file, conf.py.
PATH_OF_THIS_FILE = getsourcefile(lambda: 0) # noqa: WPS522
DOCS_DIRECTORY = os.path.dirname(os.path.abspath(PATH_OF_THIS_FILE)) # type: ignore


def ensure_pandoc_installed(_):
import pypandoc # pylint: disable=import-outside-toplevel

# Download pandoc if necessary. If pandoc is already installed and on
# the PATH, the installed version will be used. Otherwise, we will
# download a copy of pandoc into docs/bin/ and add that to our PATH.
pandoc_dir = os.path.join(DOCS_DIRECTORY, "bin")
# Add dir containing pandoc binary to the PATH environment variable
if pandoc_dir not in os.environ["PATH"].split(os.pathsep):
os.environ["PATH"] += os.pathsep + pandoc_dir
pypandoc.ensure_pandoc_installed(
version="2.11.4",
targetfolder=pandoc_dir,
delete_installer=True,
)


def setup(app):
app.connect("builder-inited", ensure_pandoc_installed)
5 changes: 5 additions & 0 deletions docs/docsrc/tutorials/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Tutorials
=========

.. toctree::
notebooks/tutorial
3 changes: 3 additions & 0 deletions docs/docsrc/tutorials/notebooks/est_cat.fits
Git LFS file not shown
60 changes: 60 additions & 0 deletions docs/docsrc/tutorials/notebooks/predict.html

Large diffs are not rendered by default.

Loading

0 comments on commit 3a33df5

Please sign in to comment.