Your function seems very useful. I'm not sure I understand the difference between radius and bounding radius.
I think the radius is the distance around each point where I want to measure K. Bounding radius seems to be the radius of the study area, used for spatial randomness assumptions? (Not having a perfect circular area, I'm using the maximum axis distance between two observations)
import ripleyk
# p1 is list of coordinate pairs
print(p1[2:7])
xs = np.array([i[0] for i in p1])
ys = np.array([i[1] for i in p1])
print(f"Xrange is: {max(xs) - min(xs)}")
print(f"Yrange is: {max(ys) - min(ys)}")
radius = [10,20]
bounding_radius = 150
k = ripleyk.calculate_ripley(radius, bounding_radius, d1=xs, d2=ys, CSR_Normalise=True)
k
[(56, 113), (43, 106), (41, 117), (67, 59)]
Xrange is: 90
Yrange is: 146
[2827.433388230814, 10040.27366432983]
So the output is the K value corresponding to each radius in the input. Do you have an implementation of p-value calculation (or rough estimation)? This very interesting paper minimizes Monte Carlo simulations for p-val estimation by having a model of point distribution that accounts for intensity and study area size.