Code Duplication    Length = 18-18 lines in 2 locations

tests/test_Apex.py 2 locations

@@ 873-890 (lines=18) @@
870
        np.testing.assert_allclose(mapped, test_mapped, rtol=1e-5)
871
        return
872
873
    @pytest.mark.parametrize('ivec', range(0, 5))
874
    def test_map_V_to_height_array_location(self, ivec):
875
        """Test mapping of velocity to a specified height with array input."""
876
        # Set the base input and output values
877
        evel = np.array([[1, 2, 3]] * 2).transpose()
878
        in_args = [60, 15, 100, 500, evel]
879
        test_mapped = np.full(shape=(2, 3),
880
                              fill_value=[0.81971957, 2.84512495,
881
                                          0.69545001]).transpose()
882
883
        # Update inputs for one vectorized value if this is a location input
884
        if ivec < 4:
885
            in_args[ivec] = [in_args[ivec], in_args[ivec]]
886
887
        # Get the mapped output and test the results
888
        mapped = self.apex_out.map_V_to_height(*in_args)
889
        np.testing.assert_allclose(mapped, test_mapped, rtol=1e-5)
890
        return
891
892
893
class TestApexBasevectorMethods():
@@ 835-852 (lines=18) @@
832
        np.testing.assert_allclose(mapped, test_mapped, rtol=1e-5)
833
        return
834
835
    @pytest.mark.parametrize('ivec', range(0, 5))
836
    def test_map_E_to_height_array_location(self, ivec):
837
        """Test mapping of E-field to a specified height with array input."""
838
        # Set the base input and output values
839
        efield = np.array([[1, 2, 3]] * 2).transpose()
840
        in_args = [60, 15, 100, 500, efield]
841
        test_mapped = np.full(shape=(2, 3),
842
                              fill_value=[0.71152183, 2.35624876,
843
                                          0.57260784]).transpose()
844
845
        # Update inputs for one vectorized value if this is a location input
846
        if ivec < 4:
847
            in_args[ivec] = [in_args[ivec], in_args[ivec]]
848
849
        # Get the mapped output and test the results
850
        mapped = self.apex_out.map_E_to_height(*in_args)
851
        np.testing.assert_allclose(mapped, test_mapped, rtol=1e-5)
852
        return
853
854
    @pytest.mark.parametrize("in_args,test_mapped",
855
                             [([60, 15, 100, 500, [1, 2, 3]],