Skip to content

Commit

Permalink
Merge branch 'main' into less-daunting-contribution-text
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelClerx authored Oct 21, 2023
2 parents b7f1f56 + 4323e8b commit 925b8f4
Show file tree
Hide file tree
Showing 80 changed files with 1,138 additions and 758 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/copyright-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Copyright
on:
push:
branches:
- master
- main
pull_request:
# Run workflow when PR is changed, or when changed from draft to ready
types: [opened, synchronize, reopened, ready_for_review]
Expand All @@ -20,10 +20,12 @@ jobs:
if: github.event.pull_request.draft == false

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: install pints
run: |
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/coverage-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Coverage
on:
push:
branches:
- master
- main
pull_request:
# Run workflow when PR is changed, or when changed from draft to ready
types: [opened, synchronize, reopened, ready_for_review]
Expand All @@ -20,10 +20,12 @@ jobs:
if: github.event.pull_request.draft == false

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: install pints
run: |
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/docs-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Doctest
on:
push:
branches:
- master
- main
pull_request:
# Run workflow when PR is changed, or when changed from draft to ready
types: [opened, synchronize, reopened, ready_for_review]
Expand All @@ -20,10 +20,12 @@ jobs:
if: github.event.pull_request.draft == false

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: install pints
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/notebook-interfaces-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.11'

# We use e.g. install pints[stan] to install dependencies for interfaces
# that have some code in pints/interfaces. Dependencies that are not used
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/notebook-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: install pints
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/style-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Style tests (flake8)
on:
push:
branches:
- master
- main
pull_request:
# Run workflow when PR is changed, or when changed from draft to ready
types: [opened, synchronize, reopened, ready_for_review]
Expand All @@ -20,10 +20,10 @@ jobs:
if: github.event.pull_request.draft == false

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4

- name: install pints
run: |
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/unit-test-os-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Unit tests (OS versions)
on:
push:
branches:
- master
- main
pull_request:
# Run workflow when PR is changed, or when changed from draft to ready
types: [opened, synchronize, reopened, ready_for_review]
Expand All @@ -21,13 +21,16 @@ jobs:

strategy:
matrix:
os: [ubuntu-18.04, macos-latest, windows-latest]
os: [ubuntu-20.04, macos-latest, windows-latest]
# Note: Ubuntu 22 is checked by other tests

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: install pints
run: |
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/unit-test-python-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Unit tests (python versions)
on:
push:
branches:
- master
- main
pull_request:
# Run workflow when PR is changed, or when changed from draft to ready
types: [opened, synchronize, reopened, ready_for_review]
Expand All @@ -21,13 +21,14 @@ jobs:

strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10']
# Note: Latest version is tested by coverage test and os tests

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/upload-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: install dependencies
run: |
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ examples/interfaces/build
studies

# Virtual environments
venv*
venv/*
env/*

# Build artifacts
build/*
Expand Down
38 changes: 38 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.9" # Currently (2023-07-25) seems to be the sweet spot...
# You can also specify other tool versions:
# nodejs: "20"
# rust: "1.70"
# golang: "1.20"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/source/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: .requirements-docs.txt
- method: pip
path: .

18 changes: 15 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,19 @@ All notable changes to this project will be documented in this file.
## Unreleased

### Added
### Changed
### Deprecated
### Removed
### Fixed


## [0.5.0] - 2023-07-27

### Added
- [#1484](https://github.com/pints-team/pints/pull/1484) Added a `GaussianIntegratedLogUniformLogLikelihood` class that calculates the log-likelihood with its Gaussian noise integrated out with an uninformative prior in log-space.
- [#1466](https://github.com/pints-team/pints/pull/1466) Added a `TransformedRectangularBoundaries` class that preserves the `RectangularBoundaries` methods after transformation.
- [#1462](https://github.com/pints-team/pints/pull/1461) The `OptimisationController` now has a stopping criterion `max_evaluations`.
- [#1460](https://github.com/pints-team/pints/pull/1460) Added the `Adam` local optimiser.
- [#1460](https://github.com/pints-team/pints/pull/1460) [#1468](https://github.com/pints-team/pints/pull/1468) Added the `Adam` local optimiser.
- [#1459](https://github.com/pints-team/pints/pull/1459) [#1465](https://github.com/pints-team/pints/pull/1465) Added the `iRprop-` local optimiser.
- [#1456](https://github.com/pints-team/pints/pull/1456) Added an optional `translation` to `ScalingTransform` and added a `UnitCubeTransformation` class.
- [#1432](https://github.com/pints-team/pints/pull/1432) Added 2 new stochastic models: production and degradation model, Schlogl's system of chemical reactions. Moved the stochastic logistic model into `pints.stochastic` to take advantage of the `MarkovJumpModel`.
Expand All @@ -17,6 +27,9 @@ All notable changes to this project will be documented in this file.
- [#1378](https://github.com/pints-team/pints/pull/1378) Added a class `pints.LogNormalLogLikelihood`.

### Changed
- [#1485](https://github.com/pints-team/pints/pull/1485) PINTS is no longer tested on Ubuntu 18.04 LTS, but on 20.04 LTS and 22.04 LTS.
- [#1479](https://github.com/pints-team/pints/pull/1479) PINTS is no longer tested on Python 3.6. Testing for Python 3.11 has been added.
- [#1479](https://github.com/pints-team/pints/pull/1479) The `asyncio.coroutine` decorators have been removed from all of NUTS's coroutines in order to be compatible with Python 3.11.
- [#1466](https://github.com/pints-team/pints/pull/1466) `Transformation.convert_boundaries` will now return a `TransformedRectangularBoundaries` object if the transformation is element-wise and the given boundaries extend `RectangularBoundaries`.
- [#1458](https://github.com/pints-team/pints/pull/1458) The `GradientDescent` optimiser now sets its default learning rate as `min(sigma0)` (it can still be changed afterwards with `set_learning_rate()`).
- [#1445](https://github.com/pints-team/pints/pull/1445) Allowed multiple LogPDFs to be supplied to the MCMCController (one for each MCMC chain), and added an evaluator which evaluates each position on a separate callable.
Expand All @@ -25,12 +38,11 @@ All notable changes to this project will be documented in this file.
- [#1424](https://github.com/pints-team/pints/pull/1424) Fixed a bug in PSO that caused it to use more particles than advertised.
- [#1424](https://github.com/pints-team/pints/pull/1424) xNES, SNES, PSO, and BareCMAES no longer use a `TriangleWaveTransform` to handle rectangular boundaries (this was found to lead to optimisers diverging in some cases).

### Deprecated

### Removed
- [#1424](https://github.com/pints-team/pints/pull/1424) Removed the `TriangleWaveTransform` class previously used in some optimisers.

### Fixed
- [#1497](https://github.com/pints-team/pints/pull/1497) Fixed deprecation warning of `np.product` globally in pints.
- [#1457](https://github.com/pints-team/pints/pull/1457) Fixed typo in deprecation warning for `UnknownNoiseLikelihood`.
- [#1455](https://github.com/pints-team/pints/pull/1455) The `s` and `inv_s` properties of `ScalingTransformation` have been replaced with private properties `_s` and `_inv_s`.
- [#1450](https://github.com/pints-team/pints/pull/1450) Made `TransformedBoundaries` consistent with `Boundaries` by removing `range()` and adding `sample()`.
Expand Down
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ You now have everything you need to start making changes!
11. If you added a major new feature, perhaps it should be showcased in an [example notebook](#example-notebooks).
12. When you feel your code is finished, or at least warrants serious discussion, run the [pre-commit checks](#pre-commit-checks) and then create a [pull request](https://help.github.com/articles/about-pull-requests/) (PR) on [PINTS' GitHub page](https://github.com/pints-team/pints).
13. Update `CHANGELOG.md`, following the guidelines in the [changelog](#changelog) section.
14. Once a PR has been created, it will be reviewed by any member of the community. Changes might be suggested which you can make by simply adding new commits to the branch. When everything's finished, someone with the right GitHub permissions will merge your changes into PINTS master repository.
14. Once a PR has been created, it will be reviewed by any member of the community. Changes might be suggested which you can make by simply adding new commits to the branch. When everything's finished, someone with the right GitHub permissions will merge your changes into PINTS main repository.

Finally, if you really, really, _really_ love developing PINTS, have a look at the current [project infrastructure](#infrastructure).

Expand Down Expand Up @@ -414,12 +414,13 @@ Documentation is built using https://readthedocs.org/ and published on http://pi
Configuration files:

```
.readthedocs.yaml
.requirements-docs.txt
```

### Binder

Editable notebooks are made available using [Binder](mybinder.readthedocs.io) at https://mybinder.org/v2/gh/pints-team/pints/master?filepath=examples.
Editable notebooks are made available using [Binder](mybinder.readthedocs.io) at https://mybinder.org/v2/gh/pints-team/pints/main?filepath=examples.

Configuration files:

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2017-2022, University of Oxford (University of Oxford means the
Copyright (c) 2017-2023, University of Oxford (University of Oxford means the
Chancellor, Masters and Scholars of the University of Oxford, having an
administrative office at Wellington Square, Oxford OX1 2JD, UK).
All rights reserved.
Expand Down
31 changes: 15 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
[![Unit tests on multiple python versions](https://github.com/pints-team/pints/workflows/Unit%20tests%20on%20multiple%20python%20versions/badge.svg)](https://github.com/pints-team/pints/actions)
[![Unit tests on multiple operating systems](https://github.com/pints-team/pints/workflows/Unit%20tests%20on%20multiple%20operating%20systems/badge.svg)](https://github.com/pints-team/pints/actions)
[![codecov](https://codecov.io/gh/pints-team/pints/branch/master/graph/badge.svg)](https://codecov.io/gh/pints-team/pints)
[![Functional testing code](https://raw.githubusercontent.com/pints-team/functional-testing/master/badge-code.svg)](https://github.com/pints-team/functional-testing)
[![Functional testing results](https://raw.githubusercontent.com/pints-team/functional-testing/master/badge-results.svg)](https://www.cs.ox.ac.uk/projects/PINTS/functional-testing)
[![binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/pints-team/pints/master?filepath=examples)
[![Unit tests on multiple python versions](https://github.com/pints-team/pints/actions/workflows/unit-test-python-coverage.yml/badge.svg)](https://github.com/pints-team/pints/actions/workflows/unit-test-python-coverage.yml)
[![Unit tests on multiple operating systems](https://github.com/pints-team/pints/actions/workflows/unit-test-os-coverage.yml/badge.svg)](https://github.com/pints-team/pints/actions/workflows/unit-test-os-coverage.yml)
[![codecov](https://codecov.io/gh/pints-team/pints/branch/main/graph/badge.svg)](https://codecov.io/gh/pints-team/pints)
[![Change-point testing code](https://raw.githubusercontent.com/pints-team/change-point-testing/main/badge-code.svg)](https://github.com/pints-team/change-point-testing)
[![Change-point testing results](https://raw.githubusercontent.com/pints-team/change-point-testing/main/badge-results.svg)](https://www.cs.ox.ac.uk/projects/PINTS/functional-testing)
[![binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/pints-team/pints/main?filepath=examples)
[![readthedocs](https://readthedocs.org/projects/pints/badge/?version=latest)](http://pints.readthedocs.io/en/latest/?badge=latest)
[![BCH compliance](https://bettercodehub.com/edge/badge/pints-team/pints?branch=master)](https://bettercodehub.com/results/pints-team/pints)

# What is Pints?

PINTS (Probabilistic Inference on Noisy Time-Series) is a framework for optimisation and Bayesian inference on ODE models of noisy time-series, such as arise in electrochemistry and cardiac electrophysiology.

PINTS is described in [this publication in JORS](http://doi.org/10.5334/jors.252), and can be cited using the information given in our [CITATION file](https://github.com/pints-team/pints/blob/master/CITATION).
More information about PINTS papers can be found in the [papers directory](https://github.com/pints-team/pints/tree/master/papers).
PINTS is described in [this publication in JORS](http://doi.org/10.5334/jors.252), and can be cited using the information given in our [CITATION file](https://github.com/pints-team/pints/blob/main/CITATION).
More information about PINTS papers can be found in the [papers directory](https://github.com/pints-team/pints/tree/main/papers).


## Using PINTS
Expand All @@ -28,19 +27,19 @@ simulate(parameters, times) --> Returns a vector of model evaluations at
```

Experimental data sets in PINTS are defined simply as lists (or arrays) of `times` and corresponding experimental `values`.
If you have this kind of data, and if [your model (or model wrapper)](https://github.com/pints-team/pints/blob/master/examples/stats/custom-model.ipynb) implements the two methods above, then you are ready to start using PINTS to infer parameter values using [optimisation](https://github.com/pints-team/pints/blob/master/examples/optimisation/first-example.ipynb) or [sampling](https://github.com/pints-team/pints/blob/master/examples/sampling/first-example.ipynb).
If you have this kind of data, and if [your model (or model wrapper)](https://github.com/pints-team/pints/blob/main/examples/stats/custom-model.ipynb) implements the two methods above, then you are ready to start using PINTS to infer parameter values using [optimisation](https://github.com/pints-team/pints/blob/main/examples/optimisation/first-example.ipynb) or [sampling](https://github.com/pints-team/pints/blob/main/examples/sampling/first-example.ipynb).

A brief example is shown below:
![An example of using PINTS in an optimisation](https://raw.githubusercontent.com/pints-team/pints/master/example.svg)
A brief example is shown below:
![An example of using PINTS in an optimisation](https://raw.githubusercontent.com/pints-team/pints/main/example.svg)
_(Left)_ A noisy experimental time series and a computational forward model.
_(Right)_ Example code for an optimisation problem.
The full code can be [viewed here](https://github.com/pints-team/pints/blob/master/examples/sampling/readme-example.ipynb) but a friendlier, more elaborate, introduction can be found on the [examples page](https://github.com/pints-team/pints/blob/master/examples/README.md).
The full code can be [viewed here](https://github.com/pints-team/pints/blob/main/examples/sampling/readme-example.ipynb) but a friendlier, more elaborate, introduction can be found on the [examples page](https://github.com/pints-team/pints/blob/main/examples/README.md).

A graphical overview of the methods included in PINTS can be [viewed here](https://pints-team.github.io/pints-methods-overview/).

### Examples and documentation

PINTS comes with a number of [detailed examples](https://github.com/pints-team/pints/blob/master/examples/README.md), hosted here on github.
PINTS comes with a number of [detailed examples](https://github.com/pints-team/pints/blob/main/examples/README.md), hosted here on github.
In addition, there is a [full API documentation](http://pints.readthedocs.io/en/latest/), hosted on readthedocs.io.


Expand Down Expand Up @@ -72,7 +71,7 @@ $ pip uninstall pints

## What's new in this version of PINTS?

To see what's changed in the latest release, see the [CHANGELOG](https://github.com/pints-team/pints/blob/master/CHANGELOG.md).
To see what's changed in the latest release, see the [CHANGELOG](https://github.com/pints-team/pints/blob/main/CHANGELOG.md).


## Contributing to PINTS
Expand All @@ -85,7 +84,7 @@ Because PINTS is a big project, we've written extensive [contribution guidelines

## License

PINTS is fully open source. For more information about its license, see [LICENSE](https://github.com/pints-team/pints/blob/master/LICENSE.md).
PINTS is fully open source. For more information about its license, see [LICENSE](https://github.com/pints-team/pints/blob/main/LICENSE.md).


## Get in touch
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. Root of all pints docs
.. _GitHub: https://github.com/pints-team/pints
.. _Detailed examples: https://github.com/pints-team/pints/blob/master/examples/README.md
.. _Detailed examples: https://github.com/pints-team/pints/blob/main/examples/README.md

Welcome to the pints documentation
==================================
Expand Down
Loading

0 comments on commit 925b8f4

Please sign in to comment.