Skip to content

Commit

Permalink
Feature 1473 python errors (#1615)
Browse files Browse the repository at this point in the history
* Added sample script to read ascii data and create an xarray.

* Disabled use_xarray exit for testing.

* Get attrs from DataArray if using xarray.

* Removed some comments.

* Revised error messages for use with both numpy and xarray.

* Removing commented out code.

Co-authored-by: David Fillmore <[email protected]>
Co-authored-by: johnhg <[email protected]>
  • Loading branch information
3 people authored Jan 25, 2021
1 parent da5c642 commit fb7198d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ int nrows, ncols, Nx, Ny;

if ( np.n_dims() != 2 ) {

mlog << Error << "\ndataplane_from_numpy_array() -> "
<< "numpy array is not 2-dimensional! ... "
mlog << Error << "\ndataplane_from_data_array() -> "
<< "data array is not 2-dimensional! ... "
<< "(dim = " << (np.n_dims()) << ")\n\n";

exit ( 1 );
Expand Down Expand Up @@ -170,8 +170,8 @@ else if ( dtype == ">f8" ) load_numpy <double> (np.buffer(), Nx, Ny, bi

else {

mlog << Error << "\ndataplane_from_numpy_array() -> "
<< "unsupported numpy data type \"" << dtype << "\"\n\n";
mlog << Error << "\ndataplane_from_data_array() -> "
<< "unsupported data type \"" << dtype << "\"\n\n";

exit ( 1 );

Expand Down

0 comments on commit fb7198d

Please sign in to comment.