[SciPy-Dev] scipy.spatial comments

Jaakko Luttinen jaakko.luttinen@aalto...
Thu Mar 15 07:09:39 CDT 2012

On 03/11/2012 03:01 AM, Pauli Virtanen wrote:
> Hi,
> 08.03.2012 13:40, Jaakko Luttinen kirjoitti:
> [clip]
>> First, scipy/spatial/src/distance.c contains several interesting
>> distance measures. However, the vector versions are not visible outside
>> the file because they are not declared in distance.h (for instance,
>> euclidean_distance). Only the pdist_* and cdist_* versions are made
>> visible. I would like to use the "raw" distance measures directly for
>> some other functions, so would it be ok to introduce those in distance.h?
> Do you want to expose these functions so that they could be used from
> Python, or do you mean something else?
> Exposing them to Python requires also writing some additional wrappers
> in distance_wrap.c, but those seem pretty straightforward to add.

No, I'm not planning to expose them to Python. I'm writing some other
functions in C (which I'll expose to Python) and these C functions could
use the existing code for computing different distance measures between
two vectors. So just adding the functions to distance.h would suffice.

> Once you got what you like, you can either send in a pull request, or
> file an enhancement ticket with the patch attached in our tracker,
> http://projects.scipy.org/scipy/
> The pull request route is recommended as it allows for easier follow-up
> discussion &c. but there's some learning curve ahead if you have never
> worked with Git before. Some help can be found here (just substitute
> numpy -> scipy everywhere):
> http://docs.scipy.org/doc/numpy/dev/gitwash/development_workflow.html
> We'll probably improve these how-to-contribute instructions soon-ish.

Ok, thanks!

> Cheers,
> Pauli
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev

More information about the SciPy-Dev mailing list