Skip to content

Commit

Permalink
Merge pull request #25 from duncandc/test_isolation
Browse files Browse the repository at this point in the history
fixed bug in conditional_pair_matrix, also fixed typos in doc strings
  • Loading branch information
aphearin committed Mar 10, 2016
2 parents 4ab9a8d + 8b24cf4 commit 2443280
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions halotools/mock_observables/isolation_criteria.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def conditional_spherical_isolation(sample1, sample2, r_max,
\\left \\{
\\begin{array}{ll}
True & : w_1[0] > w_2[0] \\\\
False & : w_1[0] \\geq w_2[0] \\\\
False & : w_1[0] \\leq w_2[0] \\\\
\\end{array}
\\right.
Expand All @@ -297,7 +297,7 @@ def conditional_spherical_isolation(sample1, sample2, r_max,
\\left \\{
\\begin{array}{ll}
True & : w_1[0] < w_2[0] \\\\
False & : w_1[0] \\leq w_2[0] \\\\
False & : w_1[0] \\geq w_2[0] \\\\
\\end{array}
\\right.
Expand Down Expand Up @@ -470,7 +470,7 @@ def conditional_cylindrical_isolation(sample1, sample2, rp_max, pi_max,
\\left \\{
\\begin{array}{ll}
True & : w_1[0] > w_2[0] \\\\
False & : w_1[0] \\geq w_2[0] \\\\
False & : w_1[0] \\leq w_2[0] \\\\
\\end{array}
\\right.
Expand All @@ -480,7 +480,7 @@ def conditional_cylindrical_isolation(sample1, sample2, rp_max, pi_max,
\\left \\{
\\begin{array}{ll}
True & : w_1[0] < w_2[0] \\\\
False & : w_1[0] \\leq w_2[0] \\\\
False & : w_1[0] \\geq w_2[0] \\\\
\\end{array}
\\right.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ def conditional_pair_matrix(data1, data2, r_max, weights1, weights2, cond_func_i
\\left \\{
\\begin{array}{ll}
True & : w_1[0] > w_2[0] \\\\
False & : w_1[0] \\geq w_2[0] \\\\
False & : w_1[0] \\leq w_2[0] \\\\
\\end{array}
\\right.
Expand All @@ -536,7 +536,7 @@ def conditional_pair_matrix(data1, data2, r_max, weights1, weights2, cond_func_i
\\left \\{
\\begin{array}{ll}
True & : w_1[0] < w_2[0] \\\\
False & : w_1[0] \\leq w_2[0] \\\\
False & : w_1[0] \\geq w_2[0] \\\\
\\end{array}
\\right.
Expand All @@ -560,7 +560,7 @@ def conditional_pair_matrix(data1, data2, r_max, weights1, weights2, cond_func_i
\\end{array}
\\right.
#. tolerance greater than (N_marks = 1)
#. tolerance greater than (N_marks = 2)
.. math::
f(w_1,w_2) =
\\left \\{
Expand All @@ -570,7 +570,7 @@ def conditional_pair_matrix(data1, data2, r_max, weights1, weights2, cond_func_i
\\end{array}
\\right.
#. tolerance less than (N_marks = 1)
#. tolerance less than (N_marks = 2)
.. math::
f(w_1,w_2) =
\\left \\{
Expand Down Expand Up @@ -653,7 +653,7 @@ def conditional_pair_matrix(data1, data2, r_max, weights1, weights2, cond_func_i
double_tree.num_y2divs,double_tree.num_z2divs,Ncell2))

#create a function to call with only one argument
engine = partial(_conditional_pair_matrix_engine, double_tree, weights1, weights2, r_max, period, cond_func_id, PBCs)
engine = partial(_conditional_pair_matrix_engine, double_tree, weights1, weights2, r_max, period, PBCs, cond_func_id)

#do the pair counting
if num_threads>1:
Expand Down Expand Up @@ -836,7 +836,7 @@ def conditional_xy_z_pair_matrix(data1, data2, rp_max, pi_max, weights1, weights
\\left \\{
\\begin{array}{ll}
True & : w_1[0] > w_2[0] \\\\
False & : w_1[0] \\geq w_2[0] \\\\
False & : w_1[0] \\leq w_2[0] \\\\
\\end{array}
\\right.
Expand All @@ -846,7 +846,7 @@ def conditional_xy_z_pair_matrix(data1, data2, rp_max, pi_max, weights1, weights
\\left \\{
\\begin{array}{ll}
True & : w_1[0] < w_2[0] \\\\
False & : w_1[0] \\leq w_2[0] \\\\
False & : w_1[0] \\geq w_2[0] \\\\
\\end{array}
\\right.
Expand Down
4 changes: 2 additions & 2 deletions halotools/mock_observables/tests/test_isolation_criteria.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def test_conditional_spherical_isolation_cond_func2():
marks1 = np.ones(len(sample1))
marks2 = np.zeros(len(sample2))

iso = spherical_isolation(sample1, sample2, r_max, period=1)
iso = spherical_isolation(sample1, sample2, r_max, period=1.0)
assert np.all(iso == False)

cond_func = 2
Expand Down Expand Up @@ -149,7 +149,7 @@ def test_conditional_spherical_isolation_cond_func4():
cond_func = 4
marked_iso4 = conditional_spherical_isolation(sample1, sample2, r_max,
marks1, marks1, cond_func, period=1)
assert np.all(marked_iso4 == False)
assert np.all(marked_iso4 == True)



Expand Down

0 comments on commit 2443280

Please sign in to comment.