Skip to content

Commit

Permalink
Merge pull request #1510 from pints-team/main
Browse files Browse the repository at this point in the history
Merge updates from main into functional testing branch
  • Loading branch information
MichaelClerx authored Dec 12, 2023
2 parents 12e7e67 + e82aae3 commit e2e3969
Show file tree
Hide file tree
Showing 173 changed files with 15,517 additions and 10,712 deletions.
11 changes: 5 additions & 6 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,13 +20,12 @@ jobs:
if: github.event.pull_request.draft == false

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

- name: Set up Python 3.9
uses: actions/setup-python@v1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
architecture: x64
python-version: '3.11'

- name: install pints
run: |
Expand Down
11 changes: 5 additions & 6 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,13 +20,12 @@ jobs:
if: github.event.pull_request.draft == false

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

- name: Set up Python 3.9
uses: actions/setup-python@v1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
architecture: x64
python-version: '3.11'

- name: install pints
run: |
Expand Down
11 changes: 5 additions & 6 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,13 +20,12 @@ jobs:
if: github.event.pull_request.draft == false

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

- name: Set up Python 3.9
uses: actions/setup-python@v1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
architecture: x64
python-version: '3.11'

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

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

- name: Set up Python 3.9
uses: actions/setup-python@v1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
architecture: x64
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
9 changes: 4 additions & 5 deletions .github/workflows/notebook-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ jobs:
runs-on: ubuntu-latest

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

- name: Set up Python 3.9
uses: actions/setup-python@v1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
architecture: x64
python-version: '3.11'

- name: install pints
run: |
Expand Down
11 changes: 4 additions & 7 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,13 +20,10 @@ jobs:
if: github.event.pull_request.draft == false

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

- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
architecture: x64
- name: Set up Python
uses: actions/setup-python@v4

- name: install pints
run: |
Expand Down
14 changes: 7 additions & 7 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,16 +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 3.9
uses: actions/setup-python@v1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
architecture: x64
python-version: '3.11'

- name: install pints
run: |
Expand Down
15 changes: 10 additions & 5 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.5, 3.6, 3.7, 3.8, 3.9]
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@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
Expand All @@ -36,7 +37,11 @@ jobs:
run: |
python --version
python -m pip install --upgrade pip setuptools wheel
python -m pip install .[stan]
python -m pip install .
- name: install stan
if: matrix.python-version != '3.6'
run : python -m pip install .[stan]

- name: run unit tests
run: |
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/upload-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ jobs:
runs-on: ubuntu-latest

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

- name: Set up Python 3.9
uses: actions/setup-python@v1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
architecture: x64
python-version: '3.11'

- name: install dependencies
run: |
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ __pycache__/
# Jupyter checkpoints
.ipynb_checkpoints/

# Jupyter stan build files
examples/interfaces/build

# Apple stuff
.DS_Store

Expand All @@ -26,7 +29,8 @@ __pycache__/
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: .

58 changes: 57 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,64 @@

All notable changes to this project will be documented in this file.

## [Unreleased]
## Unreleased

### Added
- [#1499](https://github.com/pints-team/pints/pull/1499) Added a log-uniform prior class.
- [#1505](https://github.com/pints-team/pints/pull/1505) Added notes to `ErrorMeasure` and `LogPDF` to say parameters must be real and continuous.
### Changed
- [#1503](https://github.com/pints-team/pints/pull/1503) Stopped showing time units in controller logs, because the units change depending on the output type (see #1467).
### Deprecated
### Removed
### Fixed
- [#1505](https://github.com/pints-team/pints/pull/1505) Fixed issues with toy problems that accept invalid inputs.


## [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) [#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`.
- [#1420](https://github.com/pints-team/pints/pull/1420) The `Optimiser` class now distinguishes between a best-visited point (`x_best`, with score `f_best`) and a best-guessed point (`x_guessed`, with approximate score `f_guessed`). For most optimisers, the two values are equivalent. The `OptimisationController` still tracks `x_best` and `f_best` by default, but this can be modified using the methods `set_f_guessed_tracking` and `f_guessed_tracking`.
- [#1417](https://github.com/pints-team/pints/pull/1417) Added a module `toy.stochastic` for stochastic models. In particular, `toy.stochastic.MarkovJumpModel` implements Gillespie's algorithm for easier future implementation of stochastic models.
- [#1413](https://github.com/pints-team/pints/pull/1413) Added classes `pints.ABCController` and `pints.ABCSampler` for Approximate Bayesian computation (ABC) samplers. Added `pints.RejectionABC` which implements a simple rejection ABC sampling algorithm.
- [#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.
- [#1439](https://github.com/pints-team/pints/pull/1439), [#1433](https://github.com/pints-team/pints/pull/1433) PINTS is no longer tested on Python 3.5. Testing for Python 3.10 has been added.
- [#1435](https://github.com/pints-team/pints/pull/1435) The optional Stan interface now uses (and requires) pystan 3 or newer. The ``update_data`` method has been remove (model compilation is now cached so that there is no performance benefit to using this method).
- [#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).

### 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()`.
- [#1449](https://github.com/pints-team/pints/pull/1449) Fixed a bug in `MarkovJumpModel.interpolate_mol_counts`.
- [#1399](https://github.com/pints-team/pints/pull/1339) Fixed a bug in `DramACMC`, and fixed the number of proposal kernels to 2.


## [0.4.0] - 2021-12-07

### Added
- [#1409](https://github.com/pints-team/pints/pull/1409) The `OptimisationController` now accepts a callback function that will be called at every iteration; this can be used for easier customisation or visualisation of the optimiser trajectory.
- [#1383](https://github.com/pints-team/pints/pull/1383) Added a method `toy.TwistedGaussianDistribution.untwist` that turns samples from this distribution into samples from a multivariate Gaussian.
- [#1322](https://github.com/pints-team/pints/pull/1322) Added a method `sample_initial_points` that allows users to generate random points with finite metrics (either log-probabilities or error measures) to use as starting points for sampling or optimisation.
- [#1243](https://github.com/pints-team/pints/pull/1243) Added testing for Python 3.9.
- [#1213](https://github.com/pints-team/pints/pull/1213), [#1216](https://github.com/pints-team/pints/pull/1216) Added the truncated Gaussian distribution as a log prior, `TruncatedGaussianLogPrior`.
- [#1212](https://github.com/pints-team/pints/pull/1213) Added the `PooledLogPDF` class to allow for pooling parameters across log-pdfs.
Expand All @@ -19,6 +73,7 @@ All notable changes to this project will be documented in this file.
- [#1025](https://github.com/pints-team/pints/pull/1025) Added a stochastic logistic growth problem for use with ABC.

### Changed
- [#1420](https://github.com/pints-team/pints/pull/1420) The `OptimisationController` now logs a best and a current score.
- [#1375](https://github.com/pints-team/pints/pull/1375) Changed all arguments called `transform` to `transformation` for consistency.
- [#1365](https://github.com/pints-team/pints/pull/1365) Dropped support for Python 2.7. PINTS now requires Python 3.5 or higher.
- [#1360](https://github.com/pints-team/pints/pull/1360) The `ParallelEvaluator` will now set a different (pre-determined) random seed for each task, ensuring tasks can use randomness, but results can be reproduced from run to run.
Expand All @@ -30,6 +85,7 @@ All notable changes to this project will be documented in this file.
- [#1112](https://github.com/pints-team/pints/pull/1112) The `pints.Logger` can now deal with `None` being logged in place of a proper value.

### Deprecated
- [#1420](https://github.com/pints-team/pints/pull/1420) The methods `pints.Optimisation.xbest()` and `fbest()` are deprecated in favour of `x_best()` and `f_best()`.
- [#1201](https://github.com/pints-team/pints/pull/1201) The method `pints.rhat_all_params` was accidentally removed in 0.3.0, but is now back in deprecated form.

### Removed
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
Loading

0 comments on commit e2e3969

Please sign in to comment.