Skip to content

Commit

Permalink
Merge pull request #389 from elfi-dev/dev
Browse files Browse the repository at this point in the history
Release v0.8.1
  • Loading branch information
hpesonen authored Oct 13, 2021
2 parents e735abb + c521b22 commit 849525e
Show file tree
Hide file tree
Showing 16 changed files with 696 additions and 139 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: pytest

on:
pull_request:
push:
branches: [main]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8]

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: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install numpy
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
python -m pip install -e .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=99 --statistics
- name: Test with pytest
run: |
make test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var/

# Images
*.png
!elfi_logo_text_nobg.png
*.svg
*.jpg
*.jpeg
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ formats:

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.5
version: 3.6
install:
- requirements: requirements.txt
15 changes: 15 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
Changelog
=========

0.8.1 (2021-10-12)
------------------
- Relax tightly pinned dependency on a version of dask[distributed]
- Change lotka-volterra priors to follow the given reference
- Fix README.md badges
- Fix a few small issues with CONTRIBUTING.rst
- Add Github Actions based CI workflow
- Add the skeleton of TestBench-functionality for comparing methods
- Fix a bug of plot_traces() not working if there is only 1 chain
- Fix histograms in pair_plot diagonals and improve visual outlook
- Improve axes creation and visual outlook
- Fix a bug where precomputed evidence size was not taken into account when reporting BOLFI-results
- Fix a bug where observable nodes were not colored gray when using `elfi.draw`
- Add `plot_predicted_node_pairs` in visualization.py.

0.8.0 (2021-03-29)
------------------
Expand Down
25 changes: 17 additions & 8 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,16 @@ Get Started!
Ready to contribute? Here's how to set up `ELFI` for local development.

1. Fork the `elfi` repo on GitHub.
2. Clone your fork locally::
2. Clone your fork locally and add the base repository as a remote::

$ git clone [email protected]:your_name_here/elfi.git
$ git clone [email protected]:your_github_handle_here/elfi.git
$ cd elfi
$ git remote add upstream [email protected]:elfi-dev/elfi.git

3. Make sure you have `Python 3 <https://www.python.org/>`_ and
`Anaconda Distribution <https://www.anaconda.com/>`_ installed on your
machine. Check your conda and Python versions::
machine. Check your conda and Python versions. Currently supported Python versions
are 3.6, 3.7, 3.8::

$ conda -V
$ python -V
Expand Down Expand Up @@ -106,9 +109,15 @@ Ready to contribute? Here's how to set up `ELFI` for local development.

$ git add .
$ git commit -m "Your detailed description of your changes."

9. After committing your changes, you may sync with the base repository if there has been changes::
$ git fetch upstream
$ git rebase upstream/dev

10. Push the changes::
$ git push origin name-of-your-bugfix-or-feature

9. Submit a pull request through the GitHub website.
11. Submit a pull request through the GitHub website.

Style Guidelines
----------------
Expand All @@ -123,12 +132,12 @@ Pull Request Guidelines
Before you submit a pull request, check that it meets these guidelines:

1. The pull request should include tests that will be run automatically using
Travis-CI.
Github Actions.
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
3. The pull request should work for Python 3.6 and later. Check
https://travis-ci.org/elfi-dev/elfi/pull_requests
feature to the list in README.md.
3. The pull request should work for Python 3.6, or later. Check
https://github.com/elfi-dev/elfi/actions/workflows/pytest.yml
and make sure that the tests pass for all supported Python versions.

Tips
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
**Version 0.8.0 released!** See the [CHANGELOG](CHANGELOG.rst) and [notebooks](https://github.com/elfi-dev/notebooks).
**Version 0.8.1 released!** See the [CHANGELOG](CHANGELOG.rst) and [notebooks](https://github.com/elfi-dev/notebooks).

<img src="https://raw.githubusercontent.com/elfi-dev/elfi/dev/docs/logos/elfi_logo_text_nobg.png" width="200" />

ELFI - Engine for Likelihood-Free Inference
===========================================

[![Build Status](https://travis-ci.org/elfi-dev/elfi.svg?branch=master)](https://travis-ci.org/elfi-dev/elfi)
[![Code Health](https://landscape.io/github/elfi-dev/elfi/dev/landscape.svg?style=flat)](https://landscape.io/github/elfi-dev/elfi/dev)
[![Build Status](https://github.com/elfi-dev/elfi/actions/workflows/pytest.yml/badge.svg)](https://github.com/elfi-devs/elfi/actions)
[![Documentation Status](https://readthedocs.org/projects/elfi/badge/?version=latest)](http://elfi.readthedocs.io/en/latest/?badge=latest)
[![Gitter](https://badges.gitter.im/elfi-dev/elfi.svg)](https://gitter.im/elfi-dev/elfi?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![DOI](https://zenodo.org/badge/69855441.svg)](https://zenodo.org/badge/latestdoi/69855441)
Expand Down
Binary file added docs/logos/elfi_logo_text_nobg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion elfi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@
from elfi.model.elfi_model import *
from elfi.model.extensions import ScipyLikeDistribution as Distribution
from elfi.store import OutputPool, ArrayPool
from elfi.testbench.testbench import Testbench, TestbenchMethod
from elfi.visualization.visualization import nx_draw as draw
from elfi.visualization.visualization import plot_params_vs_node
from elfi.visualization.visualization import plot_predicted_summaries
from elfi.methods.bo.gpy_regression import GPyRegression

__author__ = 'ELFI authors'
__email__ = '[email protected]'

# make sure __version_ is on the last non-empty line (read by setup.py)
__version__ = '0.8.0'
__version__ = '0.8.1'
6 changes: 3 additions & 3 deletions elfi/examples/lotka_volterra.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ def get_model(n_obs=50, true_params=None, seed_obs=None, **kwargs):
priors = []
sumstats = []

priors.append(elfi.Prior(ExpUniform, -2, 0, model=m, name='r1'))
priors.append(elfi.Prior(ExpUniform, -5, -2.5, model=m, name='r2')) # easily kills populations
priors.append(elfi.Prior(ExpUniform, -2, 0, model=m, name='r3'))
priors.append(elfi.Prior(ExpUniform, -6., 2., model=m, name='r1'))
priors.append(elfi.Prior(ExpUniform, -6., 2., model=m, name='r2')) # easily kills populations
priors.append(elfi.Prior(ExpUniform, -6., 2., model=m, name='r3'))
priors.append(elfi.Prior('poisson', 50, model=m, name='prey0'))
priors.append(elfi.Prior('poisson', 100, model=m, name='predator0'))
priors.append(elfi.Prior(ExpUniform, np.log(0.5), np.log(50), model=m, name='sigma'))
Expand Down
2 changes: 1 addition & 1 deletion elfi/methods/inference/bolfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,5 +587,5 @@ def sample(self,
parameter_names=self.parameter_names,
warmup=warmup,
threshold=float(posterior.threshold),
n_sim=self.state['n_sim'],
n_sim=self.state['n_evidence'],
seed=self.seed)
2 changes: 1 addition & 1 deletion elfi/methods/mcmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def nuts(n_iter,
No-U-Turn Sampler, an improved version of the Hamiltonian (Markov Chain) Monte Carlo sampler.
Based on Algorithm 6 in
Hoffman & Gelman, depthMLR 15, 1351-1381, 2014.
Hoffman & Gelman, JMLR 15, 1593-1623, 2014.
Parameters
----------
Expand Down
Loading

0 comments on commit 849525e

Please sign in to comment.