Skip to content

Commit

Permalink
Add an acceptance test that demonstrated subsetting an existing spot …
Browse files Browse the repository at this point in the history
…forecast to the sites defined in a neighbour cube with valid IDs.
  • Loading branch information
bayliffe committed May 23, 2024
1 parent f91f59f commit 9b81fd1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions improver_tests/acceptance/SHA256SUMS
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,7 @@ d24b59b25252796d6ee2f26e7e6764b84145957b0d32a4246e075db931b7b46c ./spot-extract
332165b98af3eac6cd56c30457cc9c031b9788a1f660295a06b0108b40816b57 ./spot-extract/outputs/multi_time_kgo.nc
4cf5c380cff65016b32bd852e31a9ed3ea4ff60fcf879e75f760c63fac27c58d ./spot-extract/outputs/nearest_uk_temperatures.nc
5d68bab5444b1ee2c1ad6179bf19ba58cfc1cea60bc9684b0100c5c0035d4b74 ./spot-extract/outputs/nearest_uk_temperatures_unique_ids.nc
1f9fd7cce207521df7e357e130131e42bfb3e5fa8fcfa6d1e46b9d3c3a73771c ./spot-extract/outputs/spot_subset.nc
4084c26d66bab7a3c689178274d74460c520a5765a64dfd8fd213a81cfb97dd9 ./spot-extract/outputs/with_ecc_bounds_extract_percentile_kgo.nc
1e66371ccb77916db785fe3b269d584c929fa99ad6b4c5d5ffd153dc82b35d41 ./spot-extract/outputs/with_realization_collapse.nc
6c3ff6c8ec7409c70d04e3d0b42396fc63eb64b3a7ebbe42a679549f5e081d8f ./spot-extract/outputs/without_ecc_bounds_kgo.nc
Expand Down
19 changes: 19 additions & 0 deletions improver_tests/acceptance/test_spot_extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,3 +534,22 @@ def test_multi_time_input(tmp_path):
]
run_cli(args)
acc.compare(output_path, kgo_path)


def test_spot_subsetting(tmp_path):
"""Test subsetting of a spot forecast using a neighbour cube."""
kgo_dir = acc.kgo_root() / "spot-extract"
neighbour_path = kgo_dir / "inputs/all_methods_uk.nc"
diag_path = kgo_dir / "outputs/nearest_uk_temperatures_unique_ids.nc"
kgo_path = kgo_dir / "outputs/spot_subset.nc"
output_path = tmp_path / "output.nc"
args = [
diag_path,
neighbour_path,
"--output",
output_path,
"--subset-coord",
"wmo_id",
]
run_cli(args)
acc.compare(output_path, kgo_path)

0 comments on commit 9b81fd1

Please sign in to comment.