Skip to content

Commit

Permalink
Switch the instantiation of NumPyTraits from npy_ types to C++ types.
Browse files Browse the repository at this point in the history
  • Loading branch information
rmjarvis committed May 2, 2012
1 parent ce19f32 commit da7b58a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pysrc/Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ namespace galsim {
namespace {

template <typename T> struct NumPyTraits;
template <> struct NumPyTraits<npy_int16> { static int getCode() { return NPY_INT16; } };
template <> struct NumPyTraits<npy_int32> { static int getCode() { return NPY_INT32; } };
template <> struct NumPyTraits<npy_float32> { static int getCode() { return NPY_FLOAT32; } };
template <> struct NumPyTraits<npy_float64> { static int getCode() { return NPY_FLOAT64; } };
template <> struct NumPyTraits<int16_t> { static int getCode() { return NPY_INT16; } };
template <> struct NumPyTraits<int32_t> { static int getCode() { return NPY_INT32; } };
template <> struct NumPyTraits<float> { static int getCode() { return NPY_FLOAT32; } };
template <> struct NumPyTraits<double> { static int getCode() { return NPY_FLOAT64; } };

// return the NumPy type for a C++ class (e.g. float -> numpy.float32)
template <typename T>
Expand Down

0 comments on commit da7b58a

Please sign in to comment.