Skip to content

Commit

Permalink
docs: add sources + Fluxes NaNs warning
Browse files Browse the repository at this point in the history
  • Loading branch information
lgrcia committed Nov 28, 2023
1 parent 0d63a8f commit d37ceb0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 85 deletions.
73 changes: 4 additions & 69 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,73 +1,32 @@
# 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
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------
import toml

project = "prose"
copyright = "2023, Lionel Garcia"
author = "Lionel Garcia"


# -- 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 = [
"myst_nb",
"sphinx_copybutton",
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx.ext.autosummary",
"sphinx.ext.viewcode",
"sphinx_design",
]


# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# 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 = ["_build", "Thumbs.db", ".DS_Store"]


# -- 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_book_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"]

# Title
# get version number from pyproject.toml
# --------------------------------------
import toml

pyproject = toml.load("../pyproject.toml")
version = pyproject["tool"]["poetry"]["version"]
html_short_title = "prose"
html_title = f"{html_short_title}"
# -----

# html_logo = "_static/prose3.png"

source_suffix = {
".rst": "restructuredtext",
Expand Down Expand Up @@ -152,27 +111,3 @@
"""

open("md/all_blocks.rst", "w").write(all_blocks)

# check if blocks are tested
# --------------------------
# import os

# from prose.core.block import is_tested
# from prose.utils import get_all_blocks

# os.chdir("..")
# tested = []
# tested.append("# Tested blocks\n")
# tested.append("| Block | Tested |")
# tested.append("| ----- | ------ |")
# blocks = get_all_blocks()
# blocks = sorted(blocks, key=lambda block: block.__name__.lower())

# for block in blocks:
# _is = is_tested(block.__name__)
# tested.append(
# f" | [`{block.__name__}`]({block.__module__}.{block.__name__}) | {'✅' if _is else '❌'} |"
# )
# os.chdir("docs")

# open("./tested_blocks.md", "w").write("\n".join(tested))
25 changes: 12 additions & 13 deletions docs/ipynb/quickstart.ipynb

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions prose/fluxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def weight_function(fluxes):
def diff(fluxes: np.ndarray, weights: np.ndarray = None):
"""Returns differential fluxes.
If weights are specified, they are used to produce an artificial light curve by which all flux are differentiated (see Broeg 2005)
If weights are specified, they are used to produce an artificial light curve by which all fluxes are differentiated (see Broeg 2005).
`fluxes` must not contain NaNs.
Parameters
----------
Expand Down Expand Up @@ -284,7 +285,7 @@ def vander(consant=True, **kwargs):
pass

def diff(self, comps: np.ndarray = None):
"""Differential photometry
"""Differential photometry. `Fluxes.fluxes` must not contain NaNs.
Parameters
----------
Expand All @@ -308,7 +309,8 @@ def diff(self, comps: np.ndarray = None):
return _new

def autodiff(self):
"""Automatic differential photometry with Broeg et al. 2005
"""Automatic differential photometry with Broeg et al. 2005.
`Fluxes.fluxes` must not contain NaNs.
Returns
-------
Expand Down

0 comments on commit d37ceb0

Please sign in to comment.