Code Duplication    Length = 17-18 lines in 2 locations

aacgmv2/tests/test_dep_aacgmv2.py 2 locations

@@ 198-215 (lines=18) @@
195
                                         [82.5909, 83.1286, 83.7039]],
196
                                   rtol=1e-4)
197
198
    def test_convert_unequal_arra(self):
199
        """Test conversion for unequal sized arrays"""
200
        with warnings.catch_warnings():
201
            warnings.simplefilter("ignore")
202
            self.lat, self.lon = aacgmv2.convert(np.array([[60, 61, 62],
203
                                                           [63, 64, 65]]),
204
                                                 np.array([0]), np.array([300]),
205
                                                 self.dtime)
206
207
        assert isinstance(self.lat, np.ndarray)
208
        assert isinstance(self.lon, np.ndarray)
209
        assert self.lat.shape == self.lon.shape and self.lat.shape == (2, 3)
210
        np.testing.assert_allclose(self.lat, [[58.2258, 59.3186, 60.4040],
211
                                              [61.4820, 62.5528, 63.6164]],
212
                                   rtol=1e-4)
213
        np.testing.assert_allclose(self.lon, [[81.1685, 81.6140, 82.0872],
214
                                              [82.5909, 83.1286, 83.7039]],
215
                                   rtol=1e-4)
216
217
    def test_convert_location_failure(self):
218
        """Test conversion with a bad location"""
@@ 180-196 (lines=17) @@
177
        np.testing.assert_allclose(self.lat, [58.2258, 59.3186], rtol=1e-4)
178
        np.testing.assert_allclose(self.lon, [81.1685, 81.6140], rtol=1e-4)
179
180
    def test_convert_mult_array_mix(self):
181
        """Test conversion for a multi-dim array and floats"""
182
        with warnings.catch_warnings():
183
            warnings.simplefilter("ignore")
184
            self.lat, self.lon = aacgmv2.convert(np.array([[60, 61, 62],
185
                                                           [63, 64, 65]]), 0,
186
                                                 300, self.dtime)
187
188
        assert isinstance(self.lat, np.ndarray)
189
        assert isinstance(self.lon, np.ndarray)
190
        assert self.lat.shape == self.lon.shape and self.lat.shape == (2, 3)
191
        np.testing.assert_allclose(self.lat, [[58.2258, 59.3186, 60.4040],
192
                                         [61.4820, 62.5528, 63.6164]],
193
                                   rtol=1e-4)
194
        np.testing.assert_allclose(self.lon, [[81.1685, 81.6140, 82.0872],
195
                                         [82.5909, 83.1286, 83.7039]],
196
                                   rtol=1e-4)
197
198
    def test_convert_unequal_arra(self):
199
        """Test conversion for unequal sized arrays"""