Code Duplication    Length = 12-13 lines in 4 locations

aacgmv2/tests/test_c_aacgmv2.py 4 locations

@@ 217-229 (lines=13) @@
214
215
        del code
216
217
    def test_convert_GEOCENTRIC_A2G_TRACE(self):
218
        """Test convert from magnetic to geographic coordinates using trace"""
219
        code = aacgmv2._aacgmv2.A2G + aacgmv2._aacgmv2.TRACE + \
220
               aacgmv2._aacgmv2.GEOCENTRIC
221
        aacgmv2._aacgmv2.set_datetime(*self.date_args[0])
222
        (self.mlat, self.mlon,
223
         self.rshell) = aacgmv2._aacgmv2.convert(self.lat_in[0], self.lon_in[0],
224
                                                 self.alt_in[0], code)
225
        np.testing.assert_almost_equal(self.mlat, 30.6211, decimal=4)
226
        np.testing.assert_almost_equal(self.mlon, -94.1809, decimal=4)
227
        np.testing.assert_almost_equal(self.rshell, 1135.0000, decimal=4)
228
229
        del code
230
231
    @classmethod
232
    def test_forbidden(self):
@@ 203-215 (lines=13) @@
200
201
        del code
202
203
    def test_convert_GEOCENTRIC_G2A_TRACE(self):
204
        """Test convert from geographic to magnetic coordinates using trace"""
205
        code = aacgmv2._aacgmv2.G2A + aacgmv2._aacgmv2.TRACE + \
206
               aacgmv2._aacgmv2.GEOCENTRIC
207
        aacgmv2._aacgmv2.set_datetime(*self.date_args[0])
208
        (self.mlat, self.mlon,
209
         self.rshell) = aacgmv2._aacgmv2.convert(self.lat_in[0], self.lon_in[0],
210
                                                 self.alt_in[0], code)
211
        np.testing.assert_almost_equal(self.mlat, 48.3830, decimal=4)
212
        np.testing.assert_almost_equal(self.mlon, 57.7926, decimal=4)
213
        np.testing.assert_almost_equal(self.rshell, 1.1781, decimal=4)
214
215
        del code
216
217
    def test_convert_GEOCENTRIC_A2G_TRACE(self):
218
        """Test convert from magnetic to geographic coordinates using trace"""
@@ 190-201 (lines=12) @@
187
188
        del code
189
        
190
    def test_convert_GEOCENTRIC_A2G_coeff(self):
191
        """Test convert from magnetic to geocentric coordinates"""
192
        code = aacgmv2._aacgmv2.A2G + aacgmv2._aacgmv2.GEOCENTRIC
193
        aacgmv2._aacgmv2.set_datetime(*self.date_args[0])
194
        (self.mlat, self.mlon,
195
         self.rshell) = aacgmv2._aacgmv2.convert(self.lat_in[0], self.lon_in[0],
196
                                                 self.alt_in[0], code)
197
        np.testing.assert_almost_equal(self.mlat, 30.6101, decimal=4)
198
        np.testing.assert_almost_equal(self.mlon, -94.1806, decimal=4)
199
        np.testing.assert_almost_equal(self.rshell, 1135.0000, decimal=4)
200
201
        del code
202
203
    def test_convert_GEOCENTRIC_G2A_TRACE(self):
204
        """Test convert from geographic to magnetic coordinates using trace"""
@@ 177-188 (lines=12) @@
174
175
        del code
176
177
    def test_convert_GEOCENTRIC_G2A_coeff(self):
178
        """Test convert from geographic to magnetic coordinates"""
179
        code = aacgmv2._aacgmv2.G2A + aacgmv2._aacgmv2.GEOCENTRIC
180
        aacgmv2._aacgmv2.set_datetime(*self.date_args[0])
181
        (self.mlat, self.mlon,
182
         self.rshell) = aacgmv2._aacgmv2.convert(self.lat_in[0], self.lon_in[0],
183
                                                 self.alt_in[0], code)
184
        np.testing.assert_almost_equal(self.mlat, 48.3779, decimal=4)
185
        np.testing.assert_almost_equal(self.mlon, 57.7974, decimal=4)
186
        np.testing.assert_almost_equal(self.rshell, 1.1781, decimal=4)
187
188
        del code
189
        
190
    def test_convert_GEOCENTRIC_A2G_coeff(self):
191
        """Test convert from magnetic to geocentric coordinates"""