Skip to content
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
12 changes: 12 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally set the version of Python and requirements required to build your docs
python:
version: "3.9"
install:
- method: pip
path: .[docs]
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"restructuredtext.preview.name": "docutils"
}
17 changes: 17 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
API
====

.. currentmodule:: flip

.. autosummary::
:toctree: generated
:recursive:

flip.covariance
flip.likelihood
flip.fitter
flip.gridding
flip.model_evaluation
flip.power_spectra
flip.utils

23 changes: 23 additions & 0 deletions docs/api/flip.covariance.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
flip.covariance
===============

.. automodule:: flip.covariance



















2 changes: 2 additions & 0 deletions docs/basicusage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Getting started
===============
128 changes: 128 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# 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 sys
import os
import numpy
sys.path.insert(0, os.path.abspath('..'))
import flip

project = 'flip'
copyright = '2023, C. Ravoux'
author = 'C. Ravoux, B. Carreres'

# The full version, including alpha/beta/rc tags
release = flip.__version__

intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
'numpy': ('https://docs.scipy.org/doc/numpy/', None),
'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None),
'astropy': ('http://docs.astropy.org/en/stable/', None),
'sncosmo': ('https://sncosmo.readthedocs.io/en/stable/', None),
'pandas': ('https://pandas.pydata.org/docs/', None)}

# -- 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_parser', 'sphinx.ext.napoleon', 'sphinx_markdown_tables', 'sphinx.ext.autosectionlabel',
'sphinx.ext.linkcode', 'sphinx.ext.intersphinx', 'sphinx.ext.autodoc', 'sphinx.ext.autosummary']

napoleon_google_docstring = True
myst_enable_extensions = ["dollarmath"]
myst_dmath_double_inline = True

autosectionlabel_prefix_document = True
# 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 = []

source_suffix = {
'.rst': 'restructuredtext',
'.txt': 'markdown',
'.md': 'markdown',
}
# -- 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 = "furo"

# 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']

html_logo = ""

html_theme_options = {
"sidebar_hide_name": True,
}

import inspect
from os.path import relpath


# Copied on sncosmo documentation
def linkcode_resolve(domain, info):
"""Determine the URL corresponding to Python object."""
if domain != 'py':
return None

modname = info['module']
fullname = info['fullname']

submod = sys.modules.get(modname)
if submod is None:
return None

obj = submod
for part in fullname.split('.'):
try:
obj = getattr(obj, part)
except:
return None

try:
fn = inspect.getsourcefile(obj)
except:
fn = None
if not fn:
return None

try:
source, lineno = inspect.findsource(obj)
except:
lineno = None

if lineno:
linespec = "#L%d" % (lineno + 1)
else:
linespec = ""

fn = relpath(fn, start=flip.__flip_dir_path__)

return "https://github.com/corentinravoux/flip/tree/main/%s%s" % (fn, linespec)
24 changes: 24 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

Welcome to flip's documentation!
=================================

.. toctree::
:maxdepth: 2
:caption: Contents:

installation.rst
basicusage.rst

.. toctree::
:hidden:
:titlesonly:

api


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
10 changes: 10 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Installation
============

Clone the repository from github and install using pip.

.. code:: bash

git clone https://github.com/corentinravoux/flip.git
cd flip
pip install .
7 changes: 6 additions & 1 deletion flip/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
"""Init file of the flip package."""
from . import covariance
from . import covariance
from . import fitter
from . import gridding
from . import likelihood
from . import model_evaluation
from . import utils

__version__ = "1.0.0"
1 change: 0 additions & 1 deletion flip/model_evaluation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import numpy as np
from fitfs8 import grid_utils, joint_cov
import itertools
import matplotlib.pyplot as plt

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-e .
25 changes: 15 additions & 10 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@ email = corentin.ravoux.research@gmail.com
author = Corentin Ravoux
long_description = file : README.md
license = MIT
classifiers =
# Trove classifiers
# Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
License :: OSI Approved :: MIT License
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy


[options]
Expand All @@ -26,3 +16,18 @@ install_requires =
scipy
matplotlib
importlib-metadata
cosmoprimo @ git+https://github.com/cosmodesi/cosmoprimo


[options.extras_require]
docs =
markdown
sphinx >= 5.2.3
sphinx-markdown-tables >= 0.0.15
numpydoc
furo
myst-parser
sphinx-copybutton
sphinx-design
sphinx-inline-tabs
sphinx-tabs