[Matrix-SIG] MMTK and Surface Calculation

hinsen@dirac.cnrs-orleans.fr hinsen@dirac.cnrs-orleans.fr
Fri, 12 Nov 1999 17:35:44 +0100


> Does anyone tried the method surfaceAndVolume() in mmtk module? I don't
> manage to to run it from this small script... Do you any idea ?... Thanks!

It works in the most recent MMTK version (2.0), but it didn't work
in some earlier versions when used with newer releases of NumPy.

I recommend upgrading to the most recent versions, but if you want to
go on with what you have, replace the function init_surface in the
file _surface.c by this one:

init_surface()
{
  PyObject *m;

  /* Create the module and add the functions */
  m = Py_InitModule("_surface", surface_methods);
  
  /* Import the array module */
#ifdef import_array
  import_array();
#endif

  /* Check for errors */
  if (PyErr_Occurred())
    Py_FatalError("can't initialize module _surface");
}

I suppose that in your copy the line "import_array();" is missing, and
that causes an immediate crash with sufficiently new NumPy versions.

BTW, a better place for such questions is the MMTK mailing list!

Konrad.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                            | E-Mail: hinsen@cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.55.69
Rue Charles Sadron                       | Fax:  +33-2.38.63.15.17
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais
-------------------------------------------------------------------------------