Skip to content

Commit

Permalink
histogramdd normed argument replaced by density (#3976)
Browse files Browse the repository at this point in the history
* histogramdd normed argument replaced by density
* pin numpy for 32bit in azure pipelines
  • Loading branch information
IAlibay authored Dec 23, 2022
1 parent d8526ff commit 0c4f823
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
8 changes: 6 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
PYTHON_VERSION: '3.8'
PYTHON_ARCH: 'x86'
BUILD_TYPE: 'normal'
NUMPY_MIN: '1.20.0'
imageName: 'windows-2019'
Win-Python38-64bit-full:
PYTHON_VERSION: '3.8'
Expand Down Expand Up @@ -102,8 +103,8 @@ jobs:
# to check the ABI compatibility of our wheels
- script: >-
python -m pip install numpy==$(NUMPY_MIN)
displayName: 'pin to older NumPy (wheel test)'
condition: and(succeeded(), eq(variables['BUILD_TYPE'], 'wheel'))
displayName: 'pin to older NumPy (wheel test and 32bit)'
condition: and(succeeded(), ne(variables['NUMPY_MIN'], ''))
- script: >-
python -m pip install
biopython
Expand All @@ -120,6 +121,9 @@ jobs:
rdkit>=2020.03.1
displayName: 'Install additional dependencies for 64-bit tests'
condition: and(succeeded(), eq(variables['PYTHON_ARCH'], 'x64'))
- script: >-
pip list
displayName: 'List of installed dependencies'
- powershell: |
cd package
python setup.py install
Expand Down
9 changes: 9 additions & 0 deletions package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ Changes
Deprecations


12/21/22 IAlibay

* 2.4.2

Fixes
* np.histogramdd calls in :class:`DensityAnalysis` now pass the `density`
argument rather than the NumPy 1.24 removed `normed` (PR #3976)


12/17/22 IAlibay

* 2.4.1
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

0 comments on commit 0c4f823

Please sign in to comment.