Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ctests for obsForge #4

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .pycodestyle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[pycodestyle]
count = False
ignore = E226,E401,E402,W503
max-line-length = 160
statistics = True
exclude = Experimental
20 changes: 19 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,23 @@ set( ENABLE_MPI ON CACHE BOOL "Compile with MPI" )
# Install utility scripts.
#add_subdirectory(ush)

# Include tools.
add_subdirectory(tools)

# Include testing.
#add_subdirectory(test)
add_subdirectory(test)

## Tests
ecbuild_add_test( TARGET ${PROJECT_NAME}_coding_norms
TYPE SCRIPT
COMMAND ${PROJECT_NAME}_py_lint.sh
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/sorc/spoc/dump/mapping ${CMAKE_CURRENT_SOURCE_DIR}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
set_tests_properties( ${PROJECT_NAME}_coding_norms PROPERTIES TIMEOUT 90 )

## Package Config
ecbuild_install_project( NAME ${PROJECT_NAME} )

ecbuild_print_summary()


433 changes: 433 additions & 0 deletions test/CMakeLists.txt

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions test/testinput/bufr_bufr4backend_satwnd_amv_goes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
time window:
begin: "2018-04-14T21:00:00Z"
end: "2023-12-15T03:00:00Z"
bound to include: begin

observations:
- obs space:
name: "satwind_goes-16"
simulated variables: [windDirection, windSpeed]
obsdatain:
engine:
type: bufr
obsfile: "./testdata/gdas.t00z.satwnd.tm00.bufr_d"
mapping file: "./testinput//bufr_satwnd_amv_goes_mapping.yaml"
category: ["goes-16"]
cache categories: # optional
- ["goes-16"]
- ["goes-17"]
- ["goes-18"]
obsdataout:
engine:
type: H5File
obsfile: "./testrun/bufr4backend/gdas.t00z.satwnd.abi_goes-16.tm00.nc"

- obs space:
name: "satwind_goes-17"
simulated variables: [windDirection, windSpeed]
obsdatain:
engine:
type: bufr
obsfile: "./testdata/gdas.t00z.satwnd.tm00.bufr_d"
mapping file: "./testinput/bufr_satwnd_amv_goes_mapping.yaml"
category: ["goes-17"]
cache categories: # optional
- ["goes-16"]
- ["goes-17"]
- ["goes-18"]
obsdataout:
engine:
type: H5File
obsfile: "./testrun/bufr4backend/gdas.t00z.satwnd.abi_goes-17.tm00.nc"

- obs space:
name: "satwind_goes-18"
simulated variables: [windDirection, windSpeed]
obsdatain:
engine:
type: bufr
obsfile: "./testdata/gdas.t00z.satwnd.tm00.bufr_d"
mapping file: "./testinput/bufr_satwnd_amv_goes_mapping.yaml"
category: ["goes-18"]
cache categories: # optional
- ["goes-16"]
- ["goes-17"]
- ["goes-18"]
obsdataout:
engine:
type: H5File
obsfile: "./testrun/bufr4backend/gdas.t00z.satwnd.abi_goes-18.tm00.nc"
59 changes: 59 additions & 0 deletions test/testinput/bufr_bufr4backend_satwnd_amv_goes_mpi4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
time window:
begin: "2018-04-14T21:00:00Z"
end: "2023-12-15T03:00:00Z"
bound to include: begin

observations:
- obs space:
name: "satwind_goes-16"
simulated variables: [windDirection, windSpeed]
obsdatain:
engine:
type: bufr
obsfile: "./testdata/gdas.t00z.satwnd.tm00.bufr_d"
mapping file: "./testinput//bufr_satwnd_amv_goes_mapping.yaml"
category: ["goes-16"]
cache categories: # optional
- ["goes-16"]
- ["goes-17"]
- ["goes-18"]
obsdataout:
engine:
type: H5File
obsfile: "./testrun/bufr4backend/gdas.t00z.satwnd.abi_goes-16.tm00_mpi4.nc"

- obs space:
name: "satwind_goes-17"
simulated variables: [windDirection, windSpeed]
obsdatain:
engine:
type: bufr
obsfile: "./testdata/gdas.t00z.satwnd.tm00.bufr_d"
mapping file: "./testinput/bufr_satwnd_amv_goes_mapping.yaml"
category: ["goes-17"]
cache categories: # optional
- ["goes-16"]
- ["goes-17"]
- ["goes-18"]
obsdataout:
engine:
type: H5File
obsfile: "./testrun/bufr4backend/gdas.t00z.satwnd.abi_goes-17.tm00_mpi4.nc"

- obs space:
name: "satwind_goes-18"
simulated variables: [windDirection, windSpeed]
obsdatain:
engine:
type: bufr
obsfile: "./testdata/gdas.t00z.satwnd.tm00.bufr_d"
mapping file: "./testinput/bufr_satwnd_amv_goes_mapping.yaml"
category: ["goes-18"]
cache categories: # optional
- ["goes-16"]
- ["goes-17"]
- ["goes-18"]
obsdataout:
engine:
type: H5File
obsfile: "./testrun/bufr4backend/gdas.t00z.satwnd.abi_goes-18.tm00_mpi4.nc"
21 changes: 21 additions & 0 deletions test/testinput/bufr_bufr4backend_sfcsno.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
time window:
begin: "2018-04-14T21:00:00Z"
end: "2023-12-15T03:00:00Z"
bound to include: begin

observations:
- obs space:
name: "sfcsno_snow"
distribution:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for? I only see it in the sfcsno and not the satwnds

name: Halo
halo size: 250e3
simulated variables: [totalSnowDepth]
obsdatain:
engine:
type: bufr
obsfile: "./testdata/gdas.t00z.sfcsno.tm00.bufr_d"
mapping file: "./testinput/bufr_sfcsno_mapping.yaml"
obsdataout:
engine:
type: H5File
obsfile: "./testrun/bufr4backend/gdas.t00z.sfcsno.tm00.nc"
21 changes: 21 additions & 0 deletions test/testinput/bufr_bufr4backend_sfcsno_mpi2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
time window:
begin: "2018-04-14T21:00:00Z"
end: "2023-12-15T03:00:00Z"
bound to include: begin

observations:
- obs space:
name: "sfcsno_snow"
distribution:
name: Halo
halo size: 250e3
simulated variables: [totalSnowDepth]
obsdatain:
engine:
type: bufr
obsfile: "./testdata/gdas.t00z.sfcsno.tm00.bufr_d"
mapping file: "./testinput/bufr_sfcsno_mapping.yaml"
obsdataout:
engine:
type: H5File
obsfile: "./testrun/bufr4backend/gdas.t00z.sfcsno.tm00_mpi2.nc"
59 changes: 59 additions & 0 deletions test/testinput/bufr_script4backend_satwnd_amv_goes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
time window:
begin: "2018-04-14T21:00:00Z"
end: "2023-12-15T03:00:00Z"
bound to include: begin

observations:
- obs space:
name: "satwind_goes-16"
observed variables: [windSpeed, windDirection]
derived variables: [windEastward, windNorthward]
simulated variables: [windEastward, windNorthward]
obsdatain:
engine:
type: script
script file: "./testinput/bufr_satwnd_amv_goes.py"
args:
input_path: "./testdata/gdas.t00z.satwnd.tm00.bufr_d"
mapping_path: "./testinput/bufr_satwnd_amv_goes_mapping.yaml"
category: "goes-16"
obsdataout:
engine:
type: H5File
obsfile: "./testrun/script4backend/gdas.t00z.satwnd.abi_goes-16.tm00.nc"

- obs space:
name: "satwind_goes-17"
observed variables: [windSpeed, windDirection]
derived variables: [windEastward, windNorthward]
simulated variables: [windEastward, windNorthward]
obsdatain:
engine:
type: script
script file: "./testinput/bufr_satwnd_amv_goes.py"
args:
input_path: "./testdata/gdas.t00z.satwnd.tm00.bufr_d"
mapping_path: "./testinput/bufr_satwnd_amv_goes_mapping.yaml"
category: "goes-17"
obsdataout:
engine:
type: H5File
obsfile: "./testrun/script4backend/gdas.t00z.satwnd.abi_goes-17.tm00.nc"

- obs space:
name: "satwind_goes-18"
observed variables: [windSpeed, windDirection]
derived variables: [windEastward, windNorthward]
simulated variables: [windEastward, windNorthward]
obsdatain:
engine:
type: script
script file: "./testinput/bufr_satwnd_amv_goes.py"
args:
input_path: "./testdata/gdas.t00z.satwnd.tm00.bufr_d"
mapping_path: "./testinput/bufr_satwnd_amv_goes_mapping.yaml"
category: "goes-18"
obsdataout:
engine:
type: H5File
obsfile: "./testrun/script4backend/gdas.t00z.satwnd.abi_goes-18.tm00.nc"
59 changes: 59 additions & 0 deletions test/testinput/bufr_script4backend_satwnd_amv_goes_mpi4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
time window:
begin: "2018-04-14T21:00:00Z"
end: "2023-12-15T03:00:00Z"
bound to include: begin

observations:
- obs space:
name: "satwind_goes-16"
observed variables: [windSpeed, windDirection]
derived variables: [windEastward, windNorthward]
simulated variables: [windEastward, windNorthward]
obsdatain:
engine:
type: script
script file: "./testinput/bufr_satwnd_amv_goes.py"
args:
input_path: "./testdata/gdas.t00z.satwnd.tm00.bufr_d"
mapping_path: "./testinput/bufr_satwnd_amv_goes_mapping.yaml"
category: "goes-16"
obsdataout:
engine:
type: H5File
obsfile: "./testrun/script4backend/gdas.t00z.satwnd.abi_goes-16.tm00_mpi4.nc"

- obs space:
name: "satwind_goes-17"
observed variables: [windSpeed, windDirection]
derived variables: [windEastward, windNorthward]
simulated variables: [windEastward, windNorthward]
obsdatain:
engine:
type: script
script file: "./testinput/bufr_satwnd_amv_goes.py"
args:
input_path: "./testdata/gdas.t00z.satwnd.tm00.bufr_d"
mapping_path: "./testinput/bufr_satwnd_amv_goes_mapping.yaml"
category: "goes-17"
obsdataout:
engine:
type: H5File
obsfile: "./testrun/script4backend/gdas.t00z.satwnd.abi_goes-17.tm00_mpi4.nc"

- obs space:
name: "satwind_goes-18"
observed variables: [windSpeed, windDirection]
derived variables: [windEastward, windNorthward]
simulated variables: [windEastward, windNorthward]
obsdatain:
engine:
type: script
script file: "./testinput/bufr_satwnd_amv_goes.py"
args:
input_path: "./testdata/gdas.t00z.satwnd.tm00.bufr_d"
mapping_path: "./testinput/bufr_satwnd_amv_goes_mapping.yaml"
category: "goes-18"
obsdataout:
engine:
type: H5File
obsfile: "./testrun/script4backend/gdas.t00z.satwnd.abi_goes-18.tm00_mpi4.nc"
23 changes: 23 additions & 0 deletions test/testinput/bufr_script4backend_sfcsno.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
time window:
begin: "2018-04-14T21:00:00Z"
end: "2023-12-15T03:00:00Z"
bound to include: begin

observations:
- obs space:
name: "sfcsno_snow"
distribution:
name: Halo
halo size: 250e3
simulated variables: [totalSnowDepth]
obsdatain:
engine:
type: script
script file: "./testinput/bufr_sfcsno.py"
args:
input_path: "./testdata/gdas.t00z.sfcsno.tm00.bufr_d"
mapping_path: "./testinput//bufr_sfcsno_mapping.yaml"
obsdataout:
engine:
type: H5File
obsfile: "./testrun/script4backend/gdas.t00z.sfcsno.tm00.nc"
23 changes: 23 additions & 0 deletions test/testinput/bufr_script4backend_sfcsno_mpi2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
time window:
begin: "2018-04-14T21:00:00Z"
end: "2023-12-15T03:00:00Z"
bound to include: begin

observations:
- obs space:
name: "sfcsno_snow"
distribution:
name: Halo
halo size: 250e3
simulated variables: [totalSnowDepth]
obsdatain:
engine:
type: script
script file: "./testinput/bufr_sfcsno.py"
args:
input_path: "./testdata/gdas.t00z.sfcsno.tm00.bufr_d"
mapping_path: "./testinput//bufr_sfcsno_mapping.yaml"
obsdataout:
engine:
type: H5File
obsfile: "./testrun/script4backend/gdas.t00z.sfcsno.tm00_mpi2.nc"
2 changes: 2 additions & 0 deletions tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

add_subdirectory( build_scripts )
10 changes: 10 additions & 0 deletions tools/build_scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@


list(APPEND _scripts
obsForge_cpp_lint.py
obsForge_py_lint.sh)

foreach(_f IN LISTS _scripts)
execute_process( COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/${_f} ${CMAKE_BINARY_DIR}/bin/${_f} )
endforeach()
Loading