Code Duplication    Length = 18-18 lines in 2 locations

tests/test_Apex.py 2 locations

@@ 928-945 (lines=18) @@
925
        np.testing.assert_allclose(mapped, test_mapped, rtol=1e-5)
926
        return
927
928
    @pytest.mark.parametrize('ivec', range(0, 5))
929
    def test_map_V_to_height_array_location(self, ivec):
930
        """Test mapping of velocity to a specified height with array input."""
931
        # Set the base input and output values
932
        evel = np.array([[1, 2, 3]] * 2).transpose()
933
        in_args = [60, 15, 100, 500, evel]
934
        test_mapped = np.full(shape=(2, 3),
935
                              fill_value=[0.81971957, 2.84512495,
936
                                          0.69545001]).transpose()
937
938
        # Update inputs for one vectorized value if this is a location input
939
        if ivec < 4:
940
            in_args[ivec] = [in_args[ivec], in_args[ivec]]
941
942
        # Get the mapped output and test the results
943
        mapped = self.apex_out.map_V_to_height(*in_args)
944
        np.testing.assert_allclose(mapped, test_mapped, rtol=1e-5)
945
        return
946
947
948
class TestApexBasevectorMethods():
@@ 890-907 (lines=18) @@
887
        np.testing.assert_allclose(mapped, test_mapped, rtol=1e-5)
888
        return
889
890
    @pytest.mark.parametrize('ivec', range(0, 5))
891
    def test_map_E_to_height_array_location(self, ivec):
892
        """Test mapping of E-field to a specified height with array input."""
893
        # Set the base input and output values
894
        efield = np.array([[1, 2, 3]] * 2).transpose()
895
        in_args = [60, 15, 100, 500, efield]
896
        test_mapped = np.full(shape=(2, 3),
897
                              fill_value=[0.71152183, 2.35624876,
898
                                          0.57260784]).transpose()
899
900
        # Update inputs for one vectorized value if this is a location input
901
        if ivec < 4:
902
            in_args[ivec] = [in_args[ivec], in_args[ivec]]
903
904
        # Get the mapped output and test the results
905
        mapped = self.apex_out.map_E_to_height(*in_args)
906
        np.testing.assert_allclose(mapped, test_mapped, rtol=1e-5)
907
        return
908
909
    @pytest.mark.parametrize("in_args,test_mapped",
910
                             [([60, 15, 100, 500, [1, 2, 3]],