|
@@ 864-881 (lines=18) @@
|
| 861 |
|
np.testing.assert_allclose(mapped, test_mapped, rtol=1e-5) |
| 862 |
|
return |
| 863 |
|
|
| 864 |
|
@pytest.mark.parametrize('ivec', range(0, 5)) |
| 865 |
|
def test_map_V_to_height_array_location(self, ivec): |
| 866 |
|
"""Test mapping of velocity to a specified height with array input.""" |
| 867 |
|
# Set the base input and output values |
| 868 |
|
evel = np.array([[1, 2, 3]] * 2).transpose() |
| 869 |
|
in_args = [60, 15, 100, 500, evel] |
| 870 |
|
test_mapped = np.full(shape=(2, 3), |
| 871 |
|
fill_value=[0.81971957, 2.84512495, |
| 872 |
|
0.69545001]).transpose() |
| 873 |
|
|
| 874 |
|
# Update inputs for one vectorized value if this is a location input |
| 875 |
|
if ivec < 4: |
| 876 |
|
in_args[ivec] = [in_args[ivec], in_args[ivec]] |
| 877 |
|
|
| 878 |
|
# Get the mapped output and test the results |
| 879 |
|
mapped = self.apex_out.map_V_to_height(*in_args) |
| 880 |
|
np.testing.assert_allclose(mapped, test_mapped, rtol=1e-5) |
| 881 |
|
return |
| 882 |
|
|
| 883 |
|
|
| 884 |
|
class TestApexBasevectorMethods(): |
|
@@ 826-843 (lines=18) @@
|
| 823 |
|
np.testing.assert_allclose(mapped, test_mapped, rtol=1e-5) |
| 824 |
|
return |
| 825 |
|
|
| 826 |
|
@pytest.mark.parametrize('ivec', range(0, 5)) |
| 827 |
|
def test_map_E_to_height_array_location(self, ivec): |
| 828 |
|
"""Test mapping of E-field to a specified height with array input.""" |
| 829 |
|
# Set the base input and output values |
| 830 |
|
efield = np.array([[1, 2, 3]] * 2).transpose() |
| 831 |
|
in_args = [60, 15, 100, 500, efield] |
| 832 |
|
test_mapped = np.full(shape=(2, 3), |
| 833 |
|
fill_value=[0.71152183, 2.35624876, |
| 834 |
|
0.57260784]).transpose() |
| 835 |
|
|
| 836 |
|
# Update inputs for one vectorized value if this is a location input |
| 837 |
|
if ivec < 4: |
| 838 |
|
in_args[ivec] = [in_args[ivec], in_args[ivec]] |
| 839 |
|
|
| 840 |
|
# Get the mapped output and test the results |
| 841 |
|
mapped = self.apex_out.map_E_to_height(*in_args) |
| 842 |
|
np.testing.assert_allclose(mapped, test_mapped, rtol=1e-5) |
| 843 |
|
return |
| 844 |
|
|
| 845 |
|
@pytest.mark.parametrize("in_args,test_mapped", |
| 846 |
|
[([60, 15, 100, 500, [1, 2, 3]], |