manodeep / Corrfunc

⚡️⚡️⚡️Blazing fast correlation functions on the CPU.
https://corrfunc.readthedocs.io
MIT License
165 stars 50 forks source link

MalFunctioning of DDrppi #248

Closed huanian closed 3 years ago

huanian commented 3 years ago

General information

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...
manodeep commented 3 years ago

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

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

huanian commented 3 years ago

It works well now. Thanks for that.

manodeep commented 3 years ago

Great - thanks for the feedback