Code Duplication    Length = 26-27 lines in 2 locations

aacgmv2/tests/test_py_aacgmv2.py 2 locations

@@ 290-316 (lines=27) @@
287
                                    [1.04551548, 1.04546847, 1.04542272]],
288
                                   rtol=1e-4)
289
290
    def test_convert_latlon_arr_mult_arr_unequal(self):
291
        """Test array latlon conversion for unequal sized multi-dim array"""
292
        (self.lat_out, self.lon_out,
293
         self.r_out) = aacgmv2.convert_latlon_arr(np.array([[60, 61, 62],
294
                                                            [63, 64, 65]]),
295
                                                  np.array([0]),
296
                                                  np.array([300]), self.dtime)
297
298
        assert isinstance(self.lat_out, np.ndarray)
299
        assert isinstance(self.lon_out, np.ndarray)
300
        assert isinstance(self.r_out, np.ndarray)
301
        assert (self.r_out.shape == self.lon_out.shape and
302
                self.lat_out.shape == self.r_out.shape and
303
                self.r_out.shape == (2, 3))
304
305
        np.testing.assert_allclose(self.lat_out,
306
                                   [[58.2257709, 59.3186093, 60.4039740],
307
                                    [61.4819893, 62.5527635, 63.6163840]],
308
                                   rtol=1e-4)
309
        np.testing.assert_allclose(self.lon_out,
310
                                   [[81.1684696, 81.6139893, 82.0871880],
311
                                    [82.5909499, 83.1285895, 83.7039272]],
312
                                   rtol=1e-4)
313
        np.testing.assert_allclose(self.r_out,
314
                                   [[1.04566346, 1.04561304, 1.04556369],
315
                                    [1.04551548, 1.04546847, 1.04542272]],
316
                                   rtol=1e-4)
317
318
    def test_convert_latlon_arr_badidea_failure(self):
319
        """Test array latlon conversion failure for BADIDEA"""
@@ 263-288 (lines=26) @@
260
        np.testing.assert_allclose(self.r_out, [1.04566346, 1.04561304],
261
                                   rtol=1e-4)
262
263
    def test_convert_latlon_arr_mult_arr_mix(self):
264
        """Test array latlon conversion for mix type with multi-dim array"""
265
        (self.lat_out, self.lon_out,
266
        self.r_out) = aacgmv2.convert_latlon_arr(np.array([[60, 61, 62],
267
                                                           [63, 64, 65]]),
268
                                                 0, 300, self.dtime)
269
270
        assert isinstance(self.lat_out, np.ndarray)
271
        assert isinstance(self.lon_out, np.ndarray)
272
        assert isinstance(self.r_out, np.ndarray)
273
        assert (self.r_out.shape == self.lon_out.shape and
274
                self.lat_out.shape == self.r_out.shape and
275
                self.r_out.shape == (2, 3))
276
277
        np.testing.assert_allclose(self.lat_out,
278
                                   [[58.2257709, 59.3186093, 60.4039740],
279
                                    [61.4819893, 62.5527635, 63.6163840]],
280
                                   rtol=1e-4)
281
        np.testing.assert_allclose(self.lon_out,
282
                                   [[81.1684696, 81.6139893, 82.0871880],
283
                                    [82.5909499, 83.1285895, 83.7039272]],
284
                                   rtol=1e-4)
285
        np.testing.assert_allclose(self.r_out,
286
                                   [[1.04566346, 1.04561304, 1.04556369],
287
                                    [1.04551548, 1.04546847, 1.04542272]],
288
                                   rtol=1e-4)
289
290
    def test_convert_latlon_arr_mult_arr_unequal(self):
291
        """Test array latlon conversion for unequal sized multi-dim array"""