AboutDownloadsDocumentsForumsSource CodeIssuesNews
Date:
2009-07-22 03:57
Priority:
3
State:
Open
Submitted by:
Jacob Lewis (kinglewi)
Assigned to:
Nobody (None)
Summary:
Deprecated C helper code causes bug in Numpy 1.3.0?

Detailed description
This may be a mistake on my part, please correct me if that's so.

Using:
Mac OS 10.5.7 's X11 (XQuartz 2.3.3)
Python 2.6.2
Numpy 1.3.0 (<-- I believe this to cause the issue)

I have a heavily modified version of the parallel tempering example included with numpy that reads potential energies (up to 4000 each) for specific temperatures of a parallel tempering simulation and uses MBAR to compute the expected potential energy and its square (using the computeExpectations function).
I also have been using the C helper code until I recently updated Numpy and Python (python was 2.5.2 before, not sure what numpy was). The helper code compiles without any problems, but when I run my program it gives the following warnings after finding the helper code:

------------------------------------------------------------
(...)/MBAR/MBAR.py:1081: DeprecationWarning: PyArray_FromDims: use PyArray_SimpleNew.
log_w_kn = _MBAR.computeUnnormalizedLogWeightsCpp(self.K, self.N_max, len(self.nonzero_N_k_indices), self.nonzero_N_k_indices, self.N_k, self.f_k, self.u_kln,u_kn);

(...)/MBAR.py:1081: DeprecationWarning: PyArray_FromDimsAndDataAndDescr: use PyArray_NewFromDescr.
log_w_kn = _MBAR.computeUnnormalizedLogWeightsCpp(self.K, self.N_max, len(self.nonzero_N_k_indices), self.nonzero_N_k_indices, self.N_k, self.f_k, self.u_kln,u_kn);
-------------------------------------------------------------

I believe the problem stems from line 98 of _MBAR.c helper code where PyArray_FromDims is used. PyArray_FromDims appears to be deprecated. So, I replaced PyArray_FromDims with PyArray_SimpleNew (as per the warning) and when I tried to recompile it it gives the following compiler (gcc) warning:

-------------------------------------------------------------
_MBAR.c: In function '_MBAR_computeUnnormalizedLogWeightsCpp':
_MBAR.c:98: warning: passing argument 3 of '*(PyArray_API + 372u)' from incompatible pointer type
-------------------------------------------------------------

The new _MBAR.c with the changed line then causes the program to crash. I'm no programmer, but I thought I should bring this to your attention. Don't hurry to fix it on my account as it is not hindering my usage.
Thanks

Add A Comment: Notepad

Message  ↓
Date: 2009-07-22 15:39
Sender: Jacob Lewis

The first line should read "...included with pyMBAR..." instead of "...included
with numpy..."

No Changes Have Been Made to This Item

Feedback