Code Duplication    Length = 16-16 lines in 2 locations

aacgmv2/tests/test_c_aacgmv2.py 2 locations

@@ 275-290 (lines=16) @@
272
        del dtime, soy, mlt_args_1, mlt_args_2, mlt_args_3, mlon_1, mlon_2
273
        del mlon_3
274
275
    def test_mlt_convert(self):
276
        """Test MLT calculation with different longitudes"""
277
        mlt_args = list(self.long_date)
278
        mlt_args.extend([270.0])
279
        self.mlt = aacgmv2._aacgmv2.mlt_convert(*mlt_args)
280
        np.testing.assert_almost_equal(self.mlt, 16.2395, decimal=4)
281
282
        mlt_args[-1] = 80.0
283
        self.mlt = aacgmv2._aacgmv2.mlt_convert(*mlt_args)
284
        np.testing.assert_almost_equal(self.mlt, 3.5729, decimal=4)
285
286
        mlt_args[-1] = -90.0
287
        self.mlt = aacgmv2._aacgmv2.mlt_convert(*mlt_args)
288
        np.testing.assert_almost_equal(self.mlt, 16.2395, decimal=4)
289
290
        del mlt_args
291
292
    def test_mlt_convert_yrsec(self):
293
        """Test MLT calculation using year and seconds of year"""
@@ 237-252 (lines=16) @@
234
        with pytest.raises(RuntimeError):
235
            aacgmv2._aacgmv2.convert(7, 0, 0, aacgmv2._aacgmv2.G2A)
236
237
    def test_inv_mlt_convert(self):
238
        """Test MLT inversion"""
239
        mlt_args = list(self.long_date)
240
        mlt_args.extend([12.0])
241
        self.mlon = aacgmv2._aacgmv2.inv_mlt_convert(*mlt_args)
242
        np.testing.assert_almost_equal(self.mlon, -153.5931, decimal=4)
243
244
        mlt_args[-1] = 25.0
245
        self.mlon = aacgmv2._aacgmv2.inv_mlt_convert(*mlt_args)
246
        np.testing.assert_almost_equal(self.mlon, 41.4069, decimal=4)
247
248
        mlt_args[-1] = -1.0
249
        self.mlon = aacgmv2._aacgmv2.inv_mlt_convert(*mlt_args)
250
        np.testing.assert_almost_equal(self.mlon, 11.4069, decimal=4)
251
252
        del mlt_args
253
254
    def test_inv_mlt_convert_yrsec(self):
255
        """Test MLT inversion with year and seconds of year"""