Skip to content

Commit

Permalink
Per #1471, add a sanity check to make sure the grid and data dimensio…
Browse files Browse the repository at this point in the history
…ns actually match.
  • Loading branch information
JohnHalleyGotway committed Mar 9, 2021
1 parent 42233f6 commit 652a6a7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions met/src/libcode/vx_data2d_python/dataplane_from_numpy_array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,21 @@ else {

grid_from_python_dict(Python3_Dict(py_grid), grid_out);

}

//
// make sure the grid and data dimensions match
//

if ( grid_out.nx() != Nx || grid_out.ny() != Ny ) {

mlog << Error << "\ndataplane_from_numpy_array() -> "
<< "the grid dimensions (" << grid_out.nx() << ", "
<< grid_out.ny() << ") and data dimensions (" << Nx
<< ", " << Ny << ") do not match!\n\n";

exit ( 1 );

}

////////////////////
Expand Down

0 comments on commit 652a6a7

Please sign in to comment.