diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 61d3f5d..6982281 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 }} @@ -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 diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml deleted file mode 100644 index de73dc4..0000000 --- a/.github/workflows/coverage.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: coverage - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - runs-on: ubuntu-latest - 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@v2 - with: - env_vars: OS,PYTHON - fail_ci_if_error: true - verbose: true - files: coverage.xml diff --git a/.github/workflows/notebooks.yaml b/.github/workflows/notebooks.yaml deleted file mode 100644 index ce3410e..0000000 --- a/.github/workflows/notebooks.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: notebooks - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - runs-on: ubuntu-latest - 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 diff --git a/README.md b/README.md index 78f9efb..ee7a5dd 100644 --- a/README.md +++ b/README.md @@ -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 , just call the following on the -command line: - -```bash -pip install git+https://github.com/dirmeier/ramsey@ -``` - -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 @@ -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 , just call the following on the +command line: + +```bash +pip install git+https://github.com/dirmeier/ramsey@ +``` + +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 diff --git a/docs/requirements.txt b/docs/requirements.txt index 220483f..5642959 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -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 diff --git a/docs/source/api.rst b/docs/source/api.rst index 3cb001a..9279fca 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -1,5 +1,5 @@ -ramsey -====== +ramsey package +============== .. currentmodule:: ramsey diff --git a/docs/source/conf.py b/docs/source/conf.py index 364b502..8d7bdee 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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"], @@ -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", @@ -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" diff --git a/docs/source/index.rst b/docs/source/index.rst index 62d42c8..ffb3268 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -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 `_ and `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 @@ -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 `_. + Installation ------------ - To install from PyPI, call: .. code-block:: bash @@ -49,25 +56,25 @@ command line: pip install git+https://github.com/dirmeier/ramsey@ +See also the installation instructions for `Haiku `_ and `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" `_. -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 `_. +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 - :hidden: .. toctree:: :caption: Tutorials @@ -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: diff --git a/setup.py b/setup.py index 3d3cc2a..225f5bb 100644 --- a/setup.py +++ b/setup.py @@ -33,8 +33,7 @@ def _version(): long_description=readme(), long_description_content_type="text/markdown", url="https://github.com/ramsey-devs/ramsey", - author="Simon Dirmeier", - author_email="sfyrbnd@pm.me", + author="The ramsey developers", license="Apache 2.0", keywords="bayes jax probabilistic models gaussian process neural process", packages=find_packages(),