Code Duplication    Length = 30-31 lines in 2 locations

aacgmv2/tests/test_py_aacgmv2.py 2 locations

@@ 306-336 (lines=31) @@
303
                                    [1.04551548, 1.04546847, 1.04542272]],
304
                                   rtol=1e-4)
305
306
    def test_convert_latlon_arr_mult_arr_unequal(self):
307
        """Test array latlon conversion for unequal sized multi-dim array"""
308
        (self.lat_out, self.lon_out,
309
         self.r_out) = aacgmv2.convert_latlon_arr(np.array([[60, 61, 62],
310
                                                            [63, 64, 65]]),
311
                                                  np.array([0]),
312
                                                  np.array([300]), self.dtime)
313
314
        if not isinstance(self.lat_out, np.ndarray):
315
            raise AssertionError()
316
        if not isinstance(self.lon_out, np.ndarray):
317
            raise AssertionError()
318
        if not isinstance(self.r_out, np.ndarray):
319
            raise AssertionError()
320
        if not (self.r_out.shape == self.lon_out.shape and
321
                self.lat_out.shape == self.r_out.shape and
322
                self.r_out.shape == (2, 3)):
323
            raise AssertionError()
324
325
        np.testing.assert_allclose(self.lat_out,
326
                                   [[58.2257709, 59.3186093, 60.4039740],
327
                                    [61.4819893, 62.5527635, 63.6163840]],
328
                                   rtol=1e-4)
329
        np.testing.assert_allclose(self.lon_out,
330
                                   [[81.1684696, 81.6139893, 82.0871880],
331
                                    [82.5909499, 83.1285895, 83.7039272]],
332
                                   rtol=1e-4)
333
        np.testing.assert_allclose(self.r_out,
334
                                   [[1.04566346, 1.04561304, 1.04556369],
335
                                    [1.04551548, 1.04546847, 1.04542272]],
336
                                   rtol=1e-4)
337
338
    def test_convert_latlon_arr_badidea(self):
339
        """Test array latlon conversion for BADIDEA"""
@@ 275-304 (lines=30) @@
272
        np.testing.assert_allclose(self.r_out, [1.04566346, 1.04561304],
273
                                   rtol=1e-4)
274
275
    def test_convert_latlon_arr_mult_arr_mix(self):
276
        """Test array latlon conversion for mix type with multi-dim array"""
277
        (self.lat_out, self.lon_out,
278
        self.r_out) = aacgmv2.convert_latlon_arr(np.array([[60, 61, 62],
279
                                                           [63, 64, 65]]),
280
                                                 0, 300, self.dtime)
281
282
        if not isinstance(self.lat_out, np.ndarray):
283
            raise AssertionError()
284
        if not isinstance(self.lon_out, np.ndarray):
285
            raise AssertionError()
286
        if not isinstance(self.r_out, np.ndarray):
287
            raise AssertionError()
288
        if not (self.r_out.shape == self.lon_out.shape and
289
                self.lat_out.shape == self.r_out.shape and
290
                self.r_out.shape == (2, 3)):
291
            raise AssertionError()
292
293
        np.testing.assert_allclose(self.lat_out,
294
                                   [[58.2257709, 59.3186093, 60.4039740],
295
                                    [61.4819893, 62.5527635, 63.6163840]],
296
                                   rtol=1e-4)
297
        np.testing.assert_allclose(self.lon_out,
298
                                   [[81.1684696, 81.6139893, 82.0871880],
299
                                    [82.5909499, 83.1285895, 83.7039272]],
300
                                   rtol=1e-4)
301
        np.testing.assert_allclose(self.r_out,
302
                                   [[1.04566346, 1.04561304, 1.04556369],
303
                                    [1.04551548, 1.04546847, 1.04542272]],
304
                                   rtol=1e-4)
305
306
    def test_convert_latlon_arr_mult_arr_unequal(self):
307
        """Test array latlon conversion for unequal sized multi-dim array"""