Exactly right.  I needed these in Shapelet too, so I put the common stuff into NumpyHelper.h to avoid code duplication.