jhu-cisst / cisst

JHU ERC CISST Library
http://github.com/jhu-cisst/cisst/wiki
Other
64 stars 47 forks source link

Updates to numpy support #75

Closed pkazanzides closed 5 years ago

pkazanzides commented 5 years ago
  1. Updated to Numpy 1.7 API (no longer use deprecated items).
  2. Revised cisst_add_test on Windows to create BAT file to set PATH.
  3. Fixed bug on Windows where Numpy wrapping did not properly consider CISST_DATA_MODEL.
  4. Added support for Numpy arrays of size_t elements, when size_t is a native type (CISST_SIZE_T_NATIVE true).
  5. Added CheckIfDifferentTypes.cmake and use it to set CISST_LONG_LONG_NATIVE.
  6. If CISST_LONG_LONG_NATIVE is true, support Numpy arrays of long long and unsigned long long.
  7. Handle CR ('\r') in cisstDataGenerator
adeguet1 commented 5 years ago

I updated the check for size_t is native. It turns out that with the default gcc compiler on Ubuntu 18.04, unsigned long int and size_t are the same type, hence some errors re. trying to instantiate templated code twice. I created a second test since unsigned long int might be the same as unsigned int or unsigned long long int and trigger a compilation error not related to size_t.

Also related to cisstVectorPython, I updated some of the C++ code to use CISST_THROW instead of throw to avoid gcc warnings re. deprecation of exception specification in recent C++.

While trying to squash some gcc warnings, I also:

These changes have been tested on Ubuntu 18.04 with gcc in Debug and Release mode