Skip to content
Permalink
Browse files

Merge branch 'master' into i318-integrated-gaussian-redux

  • Loading branch information...
ben18785 committed Feb 27, 2019
2 parents dc92587 + 73f7a91 commit 0626b92daab4b67d0578e5d3d720347e5ff99319
@@ -4,6 +4,7 @@
[![functional](https://github.com/pints-team/functional-testing-results/blob/master/badge.svg)](https://github.com/pints-team/functional-testing-results)
[![binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/pints-team/pints/master?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?

@@ -22,39 +22,46 @@ relevant code.
- [XNES](./optimisation-xnes.ipynb)

### Further optimisation

- [Transformed parameter space](./optimisation-transformed-parameters.ipynb)
- [Ask-and-tell interface](./optimisation-ask-and-tell.ipynb)
- [Convenience methods fmin() and curve\_fit()](./optimisation-convenience.ipynb)
- [Multiple objectives](./optimisation-multi-objective.ipynb)
- [Transformed parameter space](./optimisation-transformed-parameters.ipynb)

## Sampling

### MCMC without gradients
- [Metropolis Random Walk MCMC](./sampling-metropolis-mcmc.ipynb)
- [Adaptive Covariance MCMC](./sampling-adaptive-covariance-mcmc.ipynb)
- [Population MCMC](./sampling-population-mcmc.ipynb)
- [Differential Evolution MCMC](./sampling-differential-evolution-mcmc.ipynb)
- [DREAM MCMC](./sampling-dream-mcmc.ipynb)
- [Emcee Hammer](./sampling-emcee-hammer.ipynb)
- [Metropolis Random Walk MCMC](./sampling-metropolis-mcmc.ipynb)
- [Population MCMC](./sampling-population-mcmc.ipynb)

### MCMC with gradients
- [Hamiltonian MCMC](./sampling-hamiltonian-mcmc.ipynb)
- [MALA MCMC](./sampling-mala-mcmc.ipynb)

### Nested sampling
- [Ellipsoidal nested rejection sampling](./sampling-ellipsoidal-nested-rejection-sampling.ipynb)

### Analysing sampling results
- [Predicted time series](./plot-mcmc-predicted-time-series.ipynb)
- [Trace plots](./plot-mcmc-trace-plots.ipynb)
- [Autocorrelation](./plot-mcmc-autocorrelation.ipynb)
- [Effective sample size](./sampling-effective-sample-size.ipynb)
- [Pairwise scatterplots](./plot-mcmc-pairwise-scatterplots.ipynb)
- [Pairwise scatterplots with KDE](./plot-mcmc-pairwise-kde-plots.ipynb)
- [Predicted time series](./plot-mcmc-predicted-time-series.ipynb)
- [Trace plots](./plot-mcmc-trace-plots.ipynb)

### Further sampling

- [Effective sample size](./sampling-effective-sample-size.ipynb)
- [Student-t noise model](./sampling-student-t-sampling-error.ipynb)
## Statistical modelling
- [Autoregressive moving average errors](./stats-autoregressive-moving-average-errors.ipynb)
- [Cauchy sampling error](./stats-cauchy-sampling-error.ipynb)
- [Integrated noise model](./sampling-integrated-gaussian-log-likelihood.ipynb)
- [Log priors](./stats-log-priors.ipynb)
- [Student-t noise model](./stats-student-t-sampling-error.ipynb)

## Toy problems

### Models

- [Beeler-Reuter action potential model](./toy-model-beeler-reuter-ap.ipynb)
- [Constant model](./toy-model-constant.ipynb)
- [Fitzhugh-Nagumo model](./toy-model-fitzhugh-nagumo.ipynb)
@@ -67,8 +74,11 @@ relevant code.
- [SIR Epidemiology model](./toy-model-sir.ipynb)

### Distributions

- [Multimodal normal distribution](./toy-distribution-multimodal-normal.ipynb)
- [Annulus](./toy-distribution-annulus.ipynb)
- [Cone](./toy-distribution-cone.ipynb)
- [High dimensional gaussian](./toy-distribution-high-dimensional-gaussian.ipynb)
- [Multimodal gaussian distribution](./toy-distribution-multimodal-gaussian.ipynb)
- [Neals Funnel](./toy-distribution-neals-funnel.ipynb)
- [Rosenbrock function](./toy-distribution-rosenbrock.ipynb)
- [Simple Egg Box](./toy-distribution-simple-egg-box.ipynb)
- [Twisted Gaussian Banana](./toy-distribution-twisted-gaussian.ipynb)
File renamed without changes.
File renamed without changes.
@@ -78,8 +78,19 @@ def run_flake8():

def run_doctests():
"""
Checks if the documentation can be built, runs any doctests (currently not
used).
Runs a number of tests related to documentation
"""

# Check documentation can be built with sphinx
doctest_sphinx()

# Check all example notebooks are in the index
doctest_examples_readme()


def doctest_sphinx():
"""
Checks that sphinx-build can be invoked without producing errors
"""
print('Checking if docs can be built.')
p = subprocess.Popen([
@@ -105,6 +116,38 @@ def run_doctests():
sys.exit(ret)


def doctest_examples_readme():
"""
Checks that every ipynb in the examples directory is included in the index
`examples/README.md`.
"""
print('\nChecking that example notebooks are indexed.')

# Index file is in ./examples/README.md
index_file = os.path.join('examples', 'README.md')
assert(os.path.isfile(index_file))

with open(index_file, 'r') as f:
index_contents = f.read()

# Get a list of all notebooks in the examples directory
notebooks = [x for x in os.listdir('examples') if x.endswith('.ipynb')]
assert(len(notebooks) > 10)

# Find which are not indexed
not_indexed = [nb for nb in notebooks if nb not in index_contents]

# Report any failures
if len(not_indexed) > 0:
print('The following notebooks are not indexed in %s:' % index_file)
for nb in sorted(not_indexed):
print(nb)
print('FAILED')
sys.exit(1)
else:
print('All example notebooks are indexed.')


def run_notebook_tests(skip_slow_books=False, executable='python'):
"""
Runs Jupyter notebook tests. Exits if they fail.

0 comments on commit 0626b92

Please sign in to comment.
You can’t perform that action at this time.