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