Code Duplication    Length = 18-18 lines in 2 locations

tests/test_Apex.py 2 locations

@@ 960-977 (lines=18) @@
957
        np.testing.assert_allclose(mapped, test_mapped, rtol=1e-5)
958
        return
959
960
    @pytest.mark.parametrize('ivec', range(0, 5))
961
    def test_map_V_to_height_array_location(self, ivec):
962
        """Test mapping of velocity to a specified height with array input."""
963
        # Set the base input and output values
964
        evel = np.array([[1, 2, 3]] * 2).transpose()
965
        in_args = [60, 15, 100, 500, evel]
966
        test_mapped = np.full(shape=(2, 3),
967
                              fill_value=[0.81971957, 2.84512495,
968
                                          0.69545001]).transpose()
969
970
        # Update inputs for one vectorized value if this is a location input
971
        if ivec < 4:
972
            in_args[ivec] = [in_args[ivec], in_args[ivec]]
973
974
        # Get the mapped output and test the results
975
        mapped = self.apex_out.map_V_to_height(*in_args)
976
        np.testing.assert_allclose(mapped, test_mapped, rtol=1e-5)
977
        return
978
979
980
class TestApexBasevectorMethods():
@@ 922-939 (lines=18) @@
919
        np.testing.assert_allclose(mapped, test_mapped, rtol=1e-5)
920
        return
921
922
    @pytest.mark.parametrize('ivec', range(0, 5))
923
    def test_map_E_to_height_array_location(self, ivec):
924
        """Test mapping of E-field to a specified height with array input."""
925
        # Set the base input and output values
926
        efield = np.array([[1, 2, 3]] * 2).transpose()
927
        in_args = [60, 15, 100, 500, efield]
928
        test_mapped = np.full(shape=(2, 3),
929
                              fill_value=[0.71152183, 2.35624876,
930
                                          0.57260784]).transpose()
931
932
        # Update inputs for one vectorized value if this is a location input
933
        if ivec < 4:
934
            in_args[ivec] = [in_args[ivec], in_args[ivec]]
935
936
        # Get the mapped output and test the results
937
        mapped = self.apex_out.map_E_to_height(*in_args)
938
        np.testing.assert_allclose(mapped, test_mapped, rtol=1e-5)
939
        return
940
941
    @pytest.mark.parametrize("in_args,test_mapped",
942
                             [([60, 15, 100, 500, [1, 2, 3]],