Commit 5a815acf authored by Nathanaël Schaeffer's avatar Nathanaël Schaeffer
Browse files

fix(python): correct order of dimensions in the python interface when nlat is...

fix(python): correct order of dimensions in the python interface when nlat is odd; fix bitbucket issue #50
parent f8442794
Pipeline #82809 passed with stages
in 4 minutes and 16 seconds
......@@ -66,6 +66,8 @@ class _SwigNonDynamicMeta(type):
import numpy as np
SHTNS_INTERFACE = _shtns.SHTNS_INTERFACE
sht_orthonormal = _shtns.sht_orthonormal
sht_fourpi = _shtns.sht_fourpi
......
......@@ -284,7 +284,7 @@ struct shtns_rot_ { // describe a rotation matrix
%apply int *OUTPUT { int *dim1 };
void __spat_shape(int *dim0, int *dim1) {
*dim0 = $self->nphi; *dim1 = $self->nlat;
if ($self->fftc_mode == 1) { // phi-contiguous
if ($self->layout & SHT_PHI_CONTIGUOUS) { // phi-contiguous
*dim0 = $self->nlat; *dim1 = $self->nphi;
}
}
......
......@@ -3172,7 +3172,7 @@ SWIGINTERN PyObject *shtns_info_st_dt_matrix(struct shtns_info *self){
}
SWIGINTERN void shtns_info___spat_shape(struct shtns_info *self,int *dim0,int *dim1){
*dim0 = self->nphi; *dim1 = self->nlat;
if (self->fftc_mode == 1) { // phi-contiguous
if (self->layout & (256*2)) { // phi-contiguous
*dim0 = self->nlat; *dim1 = self->nphi;
}
}
......@@ -7064,6 +7064,7 @@ SWIG_init(void) {
PyDict_SetItemString(md, "cvar", globals);
Py_DECREF(globals);
SWIG_addvarlink(globals, "__version__", Swig_var___version___get, Swig_var___version___set);
SWIG_Python_SetConstant(d, "SHTNS_INTERFACE",SWIG_From_int((int)(0x30500)));
SWIG_Python_SetConstant(d, "sht_orthonormal",SWIG_From_int((int)(sht_orthonormal)));
SWIG_Python_SetConstant(d, "sht_fourpi",SWIG_From_int((int)(sht_fourpi)));
SWIG_Python_SetConstant(d, "sht_schmidt",SWIG_From_int((int)(sht_schmidt)));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment