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 2 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()


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

Large diffs are not rendered by default.

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

Choose a reason for hiding this comment

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

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"
Copy link

Choose a reason for hiding this comment

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

extra slash :)

category: ["goes-16"]
cache categories: # optional
- ["goes-16"]
- ["goes-17"]
- ["goes-18"]
obsdataout:
engine:
type: H5File
obsfile: "./testrun/bufr_backend/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/bufr_backend/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/bufr_backend/gdas.t00z.satwnd.abi_goes-18.tm00.nc"
58 changes: 58 additions & 0 deletions test/testinput/bufr_bufr_backend_satwnd_amv_goes_mpi4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
time window:
begin: "2018-04-14T21:00:00Z"
end: "2023-12-15T03:00:00Z"

Choose a reason for hiding this comment

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

For my own reference, why are the satellite yamls such large time windows?

Copy link
Author

Choose a reason for hiding this comment

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

This is purposely done since we want to test several other cycles as well. So, we gave a big range.


Choose a reason for hiding this comment

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

Additionally, I think you should add " bound to include: begin"

Copy link
Author

Choose a reason for hiding this comment

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

time window:
  begin:  # datetime in ISO format
  length: # duration in ISO format
  bound to include: end # which window bound is inclusive (options: begin, end (default)).

Since the end is inclusive already (default), we should add bound to include: begin.
I will add it. Thanks!

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/bufr_backend/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/bufr_backend/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/bufr_backend/gdas.t00z.satwnd.abi_goes-18.tm00_mpi4.nc"
20 changes: 20 additions & 0 deletions test/testinput/bufr_bufr_backend_sfcsno.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
time window:
begin: "2018-04-14T21:00:00Z"
end: "2023-12-15T03:00:00Z"

Choose a reason for hiding this comment

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

I'll suggest adding:
bound to include: begin

Copy link
Author

Choose a reason for hiding this comment

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

Will do


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/bufr_backend/gdas.t00z.sfcsno.tm00.nc"
20 changes: 20 additions & 0 deletions test/testinput/bufr_bufr_backend_sfcsno_mpi2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
time window:
begin: "2018-04-14T21:00:00Z"
end: "2023-12-15T03:00:00Z"

Choose a reason for hiding this comment

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

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/bufr_backend/gdas.t00z.sfcsno.tm00_mpi2.nc"
58 changes: 58 additions & 0 deletions test/testinput/bufr_script_backend_satwnd_amv_goes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
time window:
begin: "2018-04-14T21:00:00Z"
end: "2023-12-15T03:00:00Z"

Choose a reason for hiding this comment

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

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/script_backend/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/script_backend/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/script_backend/gdas.t00z.satwnd.abi_goes-18.tm00.nc"
58 changes: 58 additions & 0 deletions test/testinput/bufr_script_backend_satwnd_amv_goes_mpi4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
time window:
begin: "2018-04-14T21:00:00Z"
end: "2023-12-15T03:00:00Z"

Choose a reason for hiding this comment

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

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/script_backend/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/script_backend/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/script_backend/gdas.t00z.satwnd.abi_goes-18.tm00_mpi4.nc"
22 changes: 22 additions & 0 deletions test/testinput/bufr_script_backend_sfcsno.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
time window:
begin: "2018-04-14T21:00:00Z"
end: "2023-12-15T03:00:00Z"

Choose a reason for hiding this comment

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

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/script_backend/gdas.t00z.sfcsno.tm00.nc"
22 changes: 22 additions & 0 deletions test/testinput/bufr_script_backend_sfcsno_mpi2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
time window:
begin: "2018-04-14T21:00:00Z"
end: "2023-12-15T03:00:00Z"

Choose a reason for hiding this comment

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

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/script_backend/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 )