Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ New features
2.4.0 (upcoming)
==================

Enhancements
------------
- In the theoretical VPF calculation (``theory.vpf``), the total volume of the random spheres can now exceed the volume of the sample [#238]

Bug fixes
---------
- Fix Python reference leak to results struct [#229]
Expand Down
16 changes: 0 additions & 16 deletions Corrfunc/theory/vpf.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,22 +196,6 @@ def vpf(rmax, nbins, nspheres, numpN, seed,
msg = "Number of counts-in-cells wanted must be at least 1"
raise ValueError(msg)

if boxsize > 0.0:
volume = boxsize * boxsize * boxsize
else:
volume = (max(X) - min(X)) * \
(max(Y) - min(Y)) * \
(max(Z) - min(Z))

volume_sphere = 4. / 3. * pi * rmax * rmax * rmax
if nspheres * volume_sphere > volume:
msg = "There are not as many independent volumes in the "\
"requested particle distribution. Num. spheres = {0} "\
"rmax = {1} => effective volume = {2}.\nVolume of particles ="\
"{3}. Reduce rmax or Nspheres"\
.format(nspheres, rmax, nspheres * volume_sphere, volume)
raise ValueError(msg)

# Ensure all input arrays are native endian
X, Y, Z = [convert_to_native_endian(arr, warn=True)
for arr in [X, Y, Z]]
Expand Down