Skip to content
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ All notable changes to this project will be documented in this file.

### Added
### Changed
- [#1713](https://github.com/pints-team/pints/pull/1713) PINTS now requires matplotlib 2.2 or newer.
### Deprecated
### Removed
### Fixed
- [#1713](https://github.com/pints-team/pints/pull/1713) Fixed Numpy 2.4.1 compatibility issues.


## [0.5.1] - 2025-09-26
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
iBSD 3-Clause License

Copyright (c) 2017-2025, University of Oxford (University of Oxford means the
Copyright (c) 2017-2026, 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
6 changes: 3 additions & 3 deletions pints/_log_likelihoods.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,13 +445,13 @@ def evaluateS1(self, x):
if self._values.ndim == 1:
where_condition = np.reshape(
self._not_censored_condition,
newshape=(np.shape(self._not_censored_condition)[0], 1, 1))
(np.shape(self._not_censored_condition)[0], 1, 1))
lower_where_condition = np.reshape(
self._lower_condition,
newshape=(np.shape(self._lower_condition)[0], 1, 1))
(np.shape(self._lower_condition)[0], 1, 1))
upper_where_condition = np.reshape(
self._upper_condition,
newshape=(np.shape(self._upper_condition)[0], 1, 1))
(np.shape(self._upper_condition)[0], 1, 1))
else:
where_condition = np.repeat(
self._not_censored_condition[:, :, np.newaxis],
Expand Down
2 changes: 1 addition & 1 deletion pints/_mcmc/_emcee_hammer.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def tell(self, fx):
next = np.copy(self._current)
next_log_pdfs = np.copy(self._current_log_pdfs)
next[self._k] = self._proposed
next_log_pdfs[self._k] = proposed_log_pdf
next_log_pdfs[self._k] = proposed_log_pdf[0]
self._current.setflags(write=False)
self._current_log_pdfs.setflags(write=False)
self._current = next
Expand Down
18 changes: 3 additions & 15 deletions pints/plot/_histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
from distutils.version import LooseVersion

import numpy as np
import scipy.stats as stats

Expand Down Expand Up @@ -44,13 +42,8 @@ def histogram(
A set of parameters for reference in the plot. For example, if true
values of parameters are known, they can be passed in for plotting.
"""
import matplotlib
import matplotlib.pyplot as plt

# Check matplotlib version
use_old_matplotlib = LooseVersion(matplotlib.__version__) \
< LooseVersion("2.2")

# If we switch to Python3 exclusively, bins and alpha can be keyword-only
# arguments
bins = 40
Expand Down Expand Up @@ -101,14 +94,9 @@ def histogram(
# Add histogram subplot
axes[i, 0].set_xlabel(parameter_names[i])
axes[i, 0].set_ylabel('Frequency')
if use_old_matplotlib: # pragma: no cover
axes[i, 0].hist(
samples_j[:, i], bins=xbins[:, i], alpha=alpha,
normed=True, label='Samples ' + str(1 + j_list))
else:
axes[i, 0].hist(
samples_j[:, i], bins=xbins[:, i], alpha=alpha,
density=True, label='Samples ' + str(1 + j_list))
axes[i, 0].hist(
samples_j[:, i], bins=xbins[:, i], alpha=alpha,
density=True, label='Samples ' + str(1 + j_list))

# Add kde plot
if kde:
Expand Down
12 changes: 1 addition & 11 deletions pints/plot/_pairwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
#
import warnings

from distutils.version import LooseVersion

import numpy as np
import scipy.stats as stats

Expand Down Expand Up @@ -58,13 +56,8 @@ def pairwise(samples,
if true values of parameters are known, they can be passed in for
plotting.
"""
import matplotlib
import matplotlib.pyplot as plt

# Check matplotlib version
use_old_matplotlib = LooseVersion(matplotlib.__version__) \
< LooseVersion("2.2")

# Check options kde and heatmap
if kde and heatmap:
raise ValueError('Cannot use `kde` and `heatmap` together.')
Expand Down Expand Up @@ -114,10 +107,7 @@ def pairwise(samples,
50 + n_percentiles / 2.)
xbins = np.linspace(xmin, xmax, bins)
axes[i, j].set_xlim(xmin, xmax)
if use_old_matplotlib: # pragma: no cover
axes[i, j].hist(samples[:, i], bins=xbins, normed=True)
else:
axes[i, j].hist(samples[:, i], bins=xbins, density=True)
axes[i, j].hist(samples[:, i], bins=xbins, density=True)

# Add kde plot
if kde:
Expand Down
Loading