Skip to content

Commit

Permalink
Fixes for the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenImhoff committed Oct 19, 2021
1 parent 671592b commit 41f69b7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions pysteps/tests/test_blending_skill_scores.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
)

# Set the dummy observation and model values
dummy_2d_array = np.array([[1, 2], [3, 4]])
dummy_2d_array = np.array([[1.0, 2.0], [3.0, 4.0]])
obs_8lev = np.repeat(dummy_2d_array[None, :, :], 8, axis=0)
obs_6lev = np.repeat(dummy_2d_array[None, :, :], 6, axis=0)
obs_9lev = np.repeat(dummy_2d_array[None, :, :], 9, axis=0)
Expand Down Expand Up @@ -213,8 +213,10 @@ def test_blending_skill_scores(
extrapolation field.
"""
domain_mask = np.full(obs[0, :, :].shape, False, dtype=bool)

# Calculate the spatial correlation of the given model field
correlations_t0 = np.array(spatial_correlation(obs, mod))
correlations_t0 = np.array(spatial_correlation(obs, mod, domain_mask))

# Check if the field has the same number of cascade levels as the model
# field and as the given n_cascade_levels
Expand Down
2 changes: 1 addition & 1 deletion pysteps/tests/test_io_bom_nwp.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_io_import_bom_nwp_xarray_shape():
("transform", None, None),
("zerovalue", 0.0, 0.1),
("unit", "mm", None),
("accutime", np.timedelta64(10, "m"), None),
("accutime", 10, None),
("zr_a", None, None),
("zr_b", None, None),
("xpixelsize", 500.0, 0.1),
Expand Down
2 changes: 1 addition & 1 deletion pysteps/tests/test_io_knmi_nwp.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_io_import_knmi_nwp_xarray_shape():
("transform", None, None),
("zerovalue", 0.0, 0.1),
("unit", "mm", None),
("accutime", np.timedelta64(60, "m"), None),
("accutime", 60, None),
("zr_a", None, None),
("zr_b", None, None),
("xpixelsize", 0.037, 0.0001),
Expand Down
2 changes: 1 addition & 1 deletion pysteps/tests/test_io_rmi_nwp.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_io_import_rmi_nwp_xarray_shape():
("transform", None, None),
("zerovalue", 0.0, 0.1),
("unit", "mm", None),
("accutime", np.timedelta64(5, "m"), None),
("accutime", 5, None),
("zr_a", None, None),
("zr_b", None, None),
("xpixelsize", 1300.0, 0.1),
Expand Down

0 comments on commit 41f69b7

Please sign in to comment.