tchlux / balltree

A very fast python-wrapped fortran implementation of a `ball tree`, includes fast `sort` and `select` codes for flat arrays as well.
MIT License
5 stars 1 forks source link

Support ball-tree usage in Fortran using fpm #1

Open ivan-pi opened 3 years ago

ivan-pi commented 3 years ago

Hello @tchlux,

If interested, I can try and prepare a Fortran package manager (fpm) manifest file (see https://github.com/fortran-lang/fpm) for your library. This would allow other Fortran programmers to use your balltree code easily.

If you haven't seen it already, feel welcome to join the Fortran Discourse: https://fortran-lang.discourse.group/

I posted there recently, about some of my own attempts at building kD-trees, quad-trees, and balltrees in Fortran: https://fortran-lang.discourse.group/t/the-counter-intuitive-rise-of-python-in-scientific-computing/469?u=ivanpribec

tchlux commented 3 years ago

Hey @ivan-pi, I appreciate the offer! Thanks for the links too, I'll check them out.

This code is not officially stable and I don't want to waste your time. The nearest neighbor calculation works, but occasionally after repeated calls for large data I'm getting a seg-fault from Python. I haven't had time to investigate and I'm the midst of multiple other projects that are higher in my priority queue. Although, I do plan on coming back to this when I've finished the other tasks.

For this code I am interested in four things:

When I get back to this work, I'd love to compare methods / code and see what performs best! So I'll be sure to keep your codes in mind.

You might be interested in one of the projects I'm working on, an automatic Fortran wrapper for Python called fmodpy. That is a very neat project that allows modern Fortran code to be imported into Python without any source code modifications. 🤓