Code Duplication    Length = 13-14 lines in 2 locations

metpy/calc/tests/test_tools.py 2 locations

@@ 138-151 (lines=14) @@
135
                                          0, 1, 1, 1, 1, 1, 1, 1, 1, 1], dtype=np.bool))
136
                          ])
137
def test_reduce_point_density(thin_point_data, radius, truth):
138
    r"""Test that reduce_point_density works."""
139
    assert_array_equal(reduce_point_density(thin_point_data, radius=radius), truth)
140
141
142
@pytest.mark.parametrize('radius, truth',
143
                         [(2.0, np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
144
                                          0, 0, 0, 0, 0, 0, 0, 0, 0, 1], dtype=np.bool)),
145
                          (0.7, np.array([1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
146
                                          0, 0, 0, 1, 0, 0, 0, 0, 0, 1], dtype=np.bool)),
147
                          (0.3, np.array([1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0,
148
                                          0, 0, 0, 1, 0, 0, 0, 1, 0, 1], dtype=np.bool)),
149
                          (0.1, np.array([1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1,
150
                                          0, 1, 1, 1, 1, 1, 1, 1, 1, 1], dtype=np.bool))
151
                          ])
152
def test_reduce_point_density_priority(thin_point_data, radius, truth):
153
    r"""Test that reduce_point_density works properly with priority."""
154
    key = np.array([8, 6, 2, 8, 6, 4, 4, 8, 8, 6, 3, 4, 3, 0, 7, 4, 3, 2, 3, 3, 9])
@@ 123-135 (lines=13) @@
120
                   [0.6230519, 0.0682618], [0.5069460, 0.2326285], [0.1324301, 0.5609478],
121
                   [0.7975495, 0.2109974], [0.7513574, 0.9870045], [0.9305814, 0.0685815],
122
                   [0.5271641, 0.7276889], [0.8116574, 0.4795037], [0.7017868, 0.5875983],
123
                   [0.5591604, 0.5579290], [0.1284860, 0.0968003], [0.2857064, 0.3862123]])
124
    return xy
125
126
127
@pytest.mark.parametrize('radius, truth',
128
                         [(2.0, np.array([1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
129
                                          0, 0, 0, 0, 0, 0, 0, 0, 0, 0], dtype=np.bool)),
130
                          (1.0, np.array([1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
131
                                          0, 0, 0, 0, 0, 0, 0, 0, 1, 0], dtype=np.bool)),
132
                          (0.3, np.array([1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0,
133
                                          0, 0, 0, 0, 0, 1, 0, 0, 0, 0], dtype=np.bool)),
134
                          (0.1, np.array([1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,
135
                                          0, 1, 1, 1, 1, 1, 1, 1, 1, 1], dtype=np.bool))
136
                          ])
137
def test_reduce_point_density(thin_point_data, radius, truth):
138
    r"""Test that reduce_point_density works."""