[PyMOAB] tag_get_data returning numpy.uint64 for HANDLE breaks tag_get_data

Issue #67 resolved
Guilherme Caminha created an issue

If I run tag_get_data on a tag of type MB_TYPE_HANDLE, it returns a numpy.uint64. This should be fine for most cases, but it breaks tag_get_data if the entity used is of type numpy.uint64, so you have to convert it to a long before calling again. Ex:

        ent1 = mb.tag_get_data(tag1, some_ent, flat=True)[0]
        some_value = mb.tag_get_data(tag2, ent1, flat=True)[0]

Raises

  File "pymoab/core.pyx", line 801, in pymoab.core.Core.tag_get_data (pymoab/core.cpp:6848)
  File "rng.pyx", line 39, in pymoab.rng.Range.__cinit__ (pymoab/rng.cpp:1600)
  File "pymoab/types.pyx", line 155, in pymoab.types._eh_array (pymoab/types.cpp:3708)
  File "pymoab/types.pyx", line 148, in pymoab.types._convert_array (pymoab/types.cpp:3439)
TypeError: 'numpy.uint64' object is not iterable

Also, what is the new procedure for submiting PRs to pymoab? Should I submit to master directly?

Comments (3)

  1. Guilherme Caminha reporter

    @pshriwise I've modified the code to check against numbers.Integral instead of long here locally and haven't pushed yet. Just saying because I saw you doing some more long verifications on your fork, and you might wanna look into this.

  2. Log in to comment