Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

histogramdd normed argument replaced by density #3976

Merged
merged 7 commits into from
Dec 23, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ The rules for this file:
* 2.5.0

Fixes
* np.histogramdd calls in :class:`DensityAnalysis` now pass the `density`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MDAnalysis/coredevs please look at discord for this one - in my opinion we probably should do a 2.4.2 release since this has effectively killed the DensityAnalysis code. However, how we do bugfix releases really should be discussed.

TLDR; I'm pushing for us to be able to do bugfixes from a separate feature branch than develop. That way PRs can keep rolling into develop without breaking semver if we need to do a bugfix release.

argument rather than the numpy 1.24 removed `density` (PR #3976)

Enhancements

Expand Down
6 changes: 3 additions & 3 deletions package/MDAnalysis/analysis/density.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def _prepare(self):
bins = BINS['Nbins']
# create empty grid with the right dimensions (and get the edges)
grid, edges = np.histogramdd(np.zeros((1, 3)), bins=bins,
range=arange, normed=False)
range=arange, density=False)
grid *= 0.0
self._grid = grid
self._edges = edges
Expand All @@ -473,7 +473,7 @@ def _prepare(self):
def _single_frame(self):
h, _ = np.histogramdd(self._atomgroup.positions,
bins=self._bins, range=self._arange,
normed=False)
density=False)
# reduce (proposed change #2542 to match the parallel version in pmda.density)
# return self._reduce(self._grid, h)
#
Expand Down Expand Up @@ -644,7 +644,7 @@ class Density(Grid):

If the input histogram consists of counts per cell then the
:meth:`Density.make_density` method converts the grid to a physical density. For
a probability density, divide it by :meth:`Density.grid.sum` or use ``normed=True``
a probability density, divide it by :meth:`Density.grid.sum` or use ``density=True``
right away in :func:`~numpy.histogramdd`.

The user *should* set the *parameters* keyword (see docs for the
Expand Down