healpy/healpy — pull request #81 by pchanial (2013-02-13 14:26:40+00:00)
Title: Simplify Alm and Healpix_Map C++ interface.

Before this patch, viewing an ndarray as an Alm or Healpix_Map C++ instance is done via a wrapper object that contains:
1) the Alm or Healpix_Map instance
2) the intermediate arr
3) a reference to the ndarray
This patch provides the functions ndarray2alm and ndarray2map to view an ndarray as Alm or Healpix_Map.

It is neither necessary to keep the intermediate arr since it doesn't own its buffer, nor it is necessary to keep an intermediate ndarray, as long as the ndarray, which owns the buffer during the Healpix_Map or Alm lifetime is contiguous and of correct type (i.e.: no temporary buffer is created in the helper functions, whose lifetime would be shorter than that of the Alm or Healpix_Map instance).

Remove hack.h, not required.
Move Alm and Healpix_Map declaration in _common.pxd.
+ new test cases test_map2alm and test_map2alm_pol

This patch adds 4 warnings:
warning: healpy/src/_common.pxd:123:45: Buffer unpacking not optimized away.
This are innocuous (I asked to the cython-user mailing list: https://groups.google.com/forum/#!topic/cython-users/L07S7zVj1wk ). They come from the inline qualifier in ndarray2map and ndarray2alm, and this qualifier is required because non-extern function in pxd file must be inline.
We could easily get rid of these warnings by putting these functions in a _common.pyx module.