Skip to content

Commit

Permalink
Per #1747, update MET to interpret longlong values as integers. NetCD…
Browse files Browse the repository at this point in the history
…F file attributes that have an LL suffix are read into python as numpy.int64 objects. Right now MET fails when trying to read those as integers. Update the parsing logic to interpret those as ints.
  • Loading branch information
JohnHalleyGotway committed Apr 6, 2021
1 parent 9a9bbc7 commit a8f530f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions met/src/libcode/vx_python3_utils/python3_dict.cc
Expand Up @@ -164,6 +164,14 @@ if ( ! a ) {

}

// If not a Long, try interpreting as LongLong for numpy.int64 values

if ( ! PyLong_Check(a) ) {

a = PyLong_FromLongLong(PyLong_AsLongLong(a));

}

if ( ! PyLong_Check(a) ) {

mlog << Error << "\nPython3_Dict::lookup_int(const char *) -> "
Expand Down

0 comments on commit a8f530f

Please sign in to comment.