diff --git a/src/pytrexio.i b/src/pytrexio.i index 1503382..f19cb6d 100644 --- a/src/pytrexio.i +++ b/src/pytrexio.i @@ -65,12 +65,15 @@ import_array(); %} +/* Typemaps below change the type of numpy array dimensions from int to int64_t */ +%numpy_typemaps(double, NPY_DOUBLE, int64_t) +%numpy_typemaps(int32_t, NPY_INT, int64_t) /* Enable write|read_safe functions to convert numpy arrays from/to double arrays */ -%apply (double* ARGOUT_ARRAY1, int DIM1) {(double * const dset_out, const int64_t dim_out)}; -%apply (double* IN_ARRAY1, int DIM1) {(const double * dset_in, const int64_t dim_in)}; +%apply (double* ARGOUT_ARRAY1, int64_t DIM1) {(double * const dset_out, const int64_t dim_out)}; +%apply (double* IN_ARRAY1, int64_t DIM1) {(const double * dset_in, const int64_t dim_in)}; /* Enable write|read_safe functions to convert numpy arrays from/to int32 arrays */ -%apply (int* ARGOUT_ARRAY1, int DIM1) {(int32_t * const dset_out, const int64_t dim_out)}; -%apply (int* IN_ARRAY1, int DIM1) {(const int32_t * dset_in, const int64_t dim_in)}; +%apply (int32_t* ARGOUT_ARRAY1, int64_t DIM1) {(int32_t * const dset_out, const int64_t dim_out)}; +%apply (int32_t* IN_ARRAY1, int64_t DIM1) {(const int32_t * dset_in, const int64_t dim_in)}; /* This tells SWIG to treat char ** dset_in pattern as a special case Enables access to trexio_[...]_write_dset_str set of functions directly, i.e.