manodeep/Corrfunc

MalFunctioning of DDrppi

huanian opened this issue · 3 comments

General information

  • Corrfunc version: 2.3.4
  • platform: MacOS
  • installation method (pip/source/other?): Source

Issue description

The function DDrppi is not working properly

Expected behavior

We expect it works well and return the number counts

Actual behavior

TypeError: DDrppi() missing 1 required positional argument: 'Z1'

What have you tried so far?

I looked up the source code, but I could not find out what Z1 stands for

Minimal failing example

I follow the exact example in this link https://corrfunc.readthedocs.io/en/master/modules/converting_rp_pi_counts.html

import Corrfunc
import numpy as np
from Corrfunc.theory import DDrppi
from Corrfunc.io import read_catalog
from Corrfunc.utils import convert_rp_pi_counts_to_wp

# Read the supplied galaxies on a periodic box
X, Y, Z = read_catalog()
N = len(X)
boxsize = 420.0

# Generate randoms on the box
rand_N = 3*N
rand_X = np.random.uniform(0, boxsize, rand_N)
rand_Y = np.random.uniform(0, boxsize, rand_N)
rand_Z = np.random.uniform(0, boxsize, rand_N)
nthreads = 2
pimax = 40.0

# Setup the bins
nrpbins = 10
bins = np.linspace(0.1, 10.0, nrpbins + 1)

# Auto pair counts in DD
autocorr=1
DD_counts = DDrppi(autocorr, nthreads, bins, X, Y, Z,periodic=False, verbose=True)

# Cross pair counts in DR
autocorr=0
DR_counts = DDrppi(autocorr, nthreads, bins, X, Y, Z,X2=rand_X, Y2=rand_Y, Z2=rand_Z,periodic=False, verbose=True)

# rest of sample code goes here...

Thanks @huanian for reporting this issue. This has been fixed by @lgarrison with commit 2660378

Please let us know if the documentation fix makes sense and you have a working code example

It works well now. Thanks for that.

Great - thanks for the feedback