Code Duplication    Length = 11-12 lines in 3 locations

aacgmv2/tests/test_dep_aacgmv2.py 3 locations

@@ 204-215 (lines=12) @@
201
        np.testing.assert_allclose(self.lat, [58.2258, 59.3186], rtol=1e-4)
202
        np.testing.assert_allclose(self.lon, [81.1685, 81.6140], rtol=1e-4)
203
204
    def test_convert_arr_mix(self):
205
        """Test conversion for an array and floats"""
206
        with warnings.catch_warnings():
207
            warnings.simplefilter("ignore")
208
            self.lat, self.lon = aacgmv2.convert(np.array([60, 61]), 0, 300,
209
                                                 self.dtime)
210
211
        assert isinstance(self.lat, np.ndarray)
212
        assert isinstance(self.lon, np.ndarray)
213
        assert len(self.lat) == len(self.lon) and len(self.lat) == 2
214
        np.testing.assert_allclose(self.lat, [58.2258, 59.3186], rtol=1e-4)
215
        np.testing.assert_allclose(self.lon, [81.1685, 81.6140], rtol=1e-4)
216
217
    def test_convert_mult_array_failure(self):
218
        """Test conversion for a multi-dim array and floats"""
@@ 191-202 (lines=12) @@
188
        np.testing.assert_allclose(self.lat, [58.2258, 59.3186], rtol=1e-4)
189
        np.testing.assert_allclose(self.lon, [81.1685, 81.6140], rtol=1e-4)
190
191
    def test_convert_list_mix(self):
192
        """Test conversion for a list and floats"""
193
        
194
        with warnings.catch_warnings():
195
            warnings.simplefilter("ignore")
196
            self.lat, self.lon = aacgmv2.convert([60, 61], 0, 300, self.dtime)
197
198
        assert isinstance(self.lat, np.ndarray)
199
        assert isinstance(self.lon, np.ndarray)
200
        assert len(self.lat) == len(self.lon) and len(self.lat) == 2
201
        np.testing.assert_allclose(self.lat, [58.2258, 59.3186], rtol=1e-4)
202
        np.testing.assert_allclose(self.lon, [81.1685, 81.6140], rtol=1e-4)
203
204
    def test_convert_arr_mix(self):
205
        """Test conversion for an array and floats"""
@@ 127-137 (lines=11) @@
124
        """Runs after every method to clean up previous testing"""
125
        del self.dtime, self.ddate, self.lat, self.lon
126
127
    def test_convert_single_val(self):
128
        """Test conversion for a single value"""
129
        with warnings.catch_warnings():
130
            warnings.simplefilter("ignore")
131
            self.lat, self.lon = aacgmv2.convert(60, 0, 300, self.dtime)
132
133
        assert isinstance(self.lat, np.ndarray)
134
        assert isinstance(self.lon, np.ndarray)
135
        assert len(self.lat) == len(self.lon) and len(self.lat) == 1
136
        np.testing.assert_allclose(self.lat, [58.2258], rtol=1e-4)
137
        np.testing.assert_allclose(self.lon, [81.1685], rtol=1e-4)
138
139
    def test_convert_list(self):
140
        """Test conversion for list input"""