Skip to content

Commit

Permalink
Replace documentation theme (#6)
Browse files Browse the repository at this point in the history
* Replace documentation theme

* Try fixing coverage

* Combine yaml files in workflows

* Improve landing page
  • Loading branch information
dirmeier authored Sep 23, 2022
1 parent 572c141 commit 71cd33d
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 118 deletions.
66 changes: 63 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,25 @@ name: ci

on:
push:
branches: [ main, devel ]
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2

test:
name: unit tests
runs-on: ubuntu-latest
needs:
- build
strategy:
matrix:
python-version:
- 3.9
python-version: [3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -28,3 +36,55 @@ jobs:
- name: Run tests
run: |
tox -e tests
coverage:
name: code coverage
runs-on: ubuntu-latest
needs:
- test
strategy:
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install tox codecov
- name: Compute code coverage
run: |
tox -e coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
env_vars: OS,PYTHON
fail_ci_if_error: false
verbose: true
files: coverage.xml

notebooks:
name: notebooks and examples
runs-on: ubuntu-latest
needs:
- test
strategy:
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install tox codecov
- name: Run notebooks
run: |
tox -e notebooks
- name: Run examples
run: |
tox -e examples
33 changes: 0 additions & 33 deletions .github/workflows/coverage.yaml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/notebooks.yaml

This file was deleted.

53 changes: 32 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,10 @@
## About

Ramsey is a library for probabilistic modelling using Haiku and JAX.

It builds upon the same module system that Haiku is using and is hence fully compatible with Haiku's and NumPyro's API.
Ramsey implements (or rather intends to implement) neural and Gaussian process models, normalizing flows, and diffusion and score-based models.

## Installation

To install from PyPI, call:

```bash
pip install ramsey
```

To install the latest GitHub <RELEASE>, just call the following on the
command line:

```bash
pip install git+https://github.com/dirmeier/ramsey@<RELEASE>
```

See also the installation instructions for Haiku and JAX.
Ramsey is a library for probabilistic modelling using [Haiku](https://github.com/deepmind/dm-haiku) and [JAX](https://github.com/google/jax).
It builds upon the same module system that Haiku is using and is hence fully compatible with Haiku's, NumPyro's API.
Ramsey implements (or rather intends to implement) neural and Gaussian process models, normalizing flows,
and diffusion and score-based models.

## Example usage

Expand Down Expand Up @@ -62,6 +45,34 @@ neural_process = hk.transform(neural_process)
params = neural_process.init(key, x_context=x, y_context=y, x_target=x)
```

## Installation

To install from PyPI, call:

```bash
pip install ramsey
```

To install the latest GitHub <RELEASE>, just call the following on the
command line:

```bash
pip install git+https://github.com/dirmeier/ramsey@<RELEASE>
```

See also the installation instructions for [Haiku](https://github.com/deepmind/dm-haiku) and [JAX](https://github.com/google/jax), if
you plan to use Ramsey on GPU/TPU.

## Contributing

Contributions in the form of pull requests are more than welcome. A good way to start is to check out issues labelled
["good first issue"](https://github.com/ramsey-devs/ramsey/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22).

In order to contribute:

1) Install Ramsey and dev dependencies via `pip install -e '.[dev]'`,
2) test your contribution/implementation by calling `tox` on the (Unix) command line before submitting a PR.

## Why Ramsey

Just as the names of other probabilistic languages are inspired by researchers in the field
Expand Down
5 changes: 3 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
jupyter
matplotlib
nbsphinx
pydata-sphinx-theme
seaborn
sphinx
sphinx-autobuild
sphinx-book-theme
sphinx-math-dollar
sphinx_autodoc_typehints
sphinx_fontawesome
sphinx_gallery
sphinx_rtd_theme
sphinxcontrib-fulltoc
4 changes: 2 additions & 2 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ramsey
======
ramsey package
==============

.. currentmodule:: ramsey

Expand Down
29 changes: 20 additions & 9 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
import glob
import os
from datetime import date

project = "ramsey"
copyright = "2021, Simon Dirmeier"
author = "Simon Dirmeier"
release = "0.0.1"
project = "Ramsey"
copyright = f"{date.today().year}, the Ramsey developers"
author = "Ramsey developers"
release = "0.0.2"

extensions = [
"nbsphinx",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.doctest",
"sphinx.ext.inheritance_diagram",
"sphinx.ext.intersphinx",
"sphinx.ext.mathjax",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx_autodoc_typehints",
"sphinx_gallery.gen_gallery",
"nbsphinx",
"sphinx_math_dollar",
"IPython.sphinxext.ipython_console_highlighting",
]


sphinx_gallery_conf = {
"examples_dirs": ["../../examples"],
"gallery_dirs": ["examples"],
Expand All @@ -29,14 +31,15 @@
"min_reported_time": 1,
}

html_static_path = ["_static"]
templates_path = ["_templates"]
html_static_path = ["_static"]

autodoc_default_options = {
"member-order": "bysource",
"special-members": True,
"exclude-members": "__repr__, __str__, __weakref__",
}

exclude_patterns = [
"_build",
"build",
Expand All @@ -47,10 +50,18 @@
"examples/*py"
]

html_theme = "sphinx_rtd_theme"

intersphinx_mapping = {
"haiku": ("https://dm-haiku.readthedocs.io/en/latest/", None),
"jax": ("https://jax.readthedocs.io/en/latest/", None),
"numpyro": ("https://num.pyro.ai/en/stable/", None),
}

html_theme = "sphinx_book_theme"

html_theme_options = {
"repository_url": "https://github.com/ramsey-devs/ramsey",
"use_repository_button": True,
"use_download_button": False,
}

html_title = "Ramsey"
41 changes: 24 additions & 17 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
Ramsey documentation
====================

Ramsey is a library for probabilistic modelling using Haiku and JAX.
It builds upon the same module system that Haiku is using
and is hence fully compatible with Haiku's and NumPyro's API. Ramsey implements
(or rather intends to implement) neural and Gaussian process models.
Ramsey is a library for probabilistic modelling using `Haiku <https://github.com/deepmind/dm-haiku>`_ and `JAX <https://github.com/google/jax>`_.
It builds upon the same module system that Haiku is using and is hence fully compatible with Haiku's, NumPyro's API.
Ramsey implements (or rather intends to implement) neural and Gaussian process models, normalizing flows,
and diffusion and score-based models.

.. code-block:: python
Expand All @@ -32,10 +32,17 @@ and is hence fully compatible with Haiku's and NumPyro's API. Ramsey implements
random.PRNGKey(1), x_context=x, y_context=y, x_target=x
)
Why Ramsey
----------

Just as the names of other probabilistic languages are inspired by researchers in the field
(e.g., Stan, Edward, Turing), Ramsey takes its name from one of my favourite philosophers/mathematicians,
`Frank Ramsey <https://plato.stanford.edu/entries/ramsey/>`_.

Installation
------------


To install from PyPI, call:

.. code-block:: bash
Expand All @@ -49,25 +56,25 @@ command line:
pip install git+https://github.com/dirmeier/ramsey@<RELEASE>
See also the installation instructions for `Haiku <https://github.com/deepmind/dm-haiku>`_ and `JAX <https://github.com/google/jax>`_, if
you plan to use Ramsey on GPU/TPU.

See also the installation instructions for Haiku and JAX.
Contributing
------------

Why Ramsey
----------
Contributions in the form of pull requests are more than welcome. A good way to start is to check out issues labelled
`"good first issue" <https://github.com/ramsey-devs/ramsey/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22>`_.

Just as the names of other probabilistic languages are inspired by researchers in the field
(e.g., Stan, Edward, Turing), Ramsey takes
its name from one of my favourite philosophers/mathematicians,
`Frank Ramsey <https://plato.stanford.edu/entries/ramsey/>`_.
In order to contribute:

1) Install Ramsey and dev dependencies via :code:`pip install -e '.[dev]'`,
2) test your contribution/implementation by calling :code:`tox` on the (Unix) command line before submitting a PR.

License
-------

Ramsey is licensed under the Apache 2.0 License
Ramsey is licensed under a Apache 2.0 License

.. toctree::
Home <self>
:hidden:

.. toctree::
:caption: Tutorials
Expand All @@ -84,7 +91,7 @@ Ramsey is licensed under the Apache 2.0 License
examples/attentive_neural_process

.. toctree::
:caption: API
:caption: API reference
:maxdepth: 1
:hidden:

Expand Down
Loading

0 comments on commit 71cd33d

Please sign in to comment.