emsig / pyfftlog

Python version of the logarithmic FFT Fortran code FFTLog by Andrew Hamilton.
Creative Commons Zero v1.0 Universal
24 stars 10 forks source link

pyfftlog in PyPI? #2

Closed JesusTorrado closed 4 years ago

JesusTorrado commented 4 years ago

Hi @prisae

Have you considered packaging pyfftlog as a Python package and uploading it to PyPI?

I'd like to make use of it in some code I plan to distribute, and with it not being on PyPi the only two options are (a) redistributing pyfftlog together with my code (con: no automatic updates, etc) or (b) using git submodules, which are a bit of a pain.

Packaging is super easy! See https://the-hitchhikers-guide-to-packaging.readthedocs.io/en/latest/quickstart.html

I can even write you a PR for it.

prisae commented 4 years ago

Hi @JesusTorrado

No, I haven't considered it, but it is actually a good idea.

i wrote the pure python version for a project of mine (https://empymod.github.io), and thought then I just dump it to GitHub too, some four years ago. But now, and particularly if you have an interest, it seems like a good thing to do.

There was once an attempt to include it directly into SciPy, see https://github.com/scipy/scipy/pull/7310 - it eventually halted, the final nail in the coffin being the change of FFT-backend in SciPy. However, it would still be a possibility, I just never got around to clean up all the edge bits.

How quick do you need it as a package? I guess I could do it this weekend.

prisae commented 4 years ago

Work started here: https://github.com/prisae/pyfftlog/pull/3 That should be definitely doable till Sunday.

JesusTorrado commented 4 years ago

Hi @prisae

Thanks! Making it more accessible should boost your user base, especially in my field, Cosmology, where fftlog apparently originated. A pity that it never made it into scipy.

I expect to publish the code in ~3 weeks, so no worry at all! Specially, please, don't work during the weekend for me :)

prisae commented 4 years ago

I did the quick, basic implementation. From now on you can do pip install pyfftlog It will currently install pyfftlog v0.2.0rc1. So from now on it should be ready. You can track the progress of the open issue until a v0.2.0 here https://github.com/prisae/pyfftlog/pull/3.

If you could try it and let me know if it works or not that would be great!

prisae commented 4 years ago

First version of docs working on RTFD (packit-branch): https://pyfftlog.readthedocs.io/en/packit/

Nothing fancy so far, just a dump.

JesusTorrado commented 4 years ago

If you could try it and let me know if it works or not that would be great!

Works, thanks!

prisae commented 4 years ago

Great! I close this issue, progress is tracked here: https://github.com/prisae/pyfftlog/pull/3

prisae commented 4 years ago

@JesusTorrado , if you are interested: I also packed quickly the wrapped version of Hamiltons original code: pip install fftlog (https://pypi.org/project/fftlog)

Deploying that is a bit trickier, as it requires compilation. As of now, there are no wheels. It works fine on linux. I assume it will work fine on a mac too, but no idea with regards to windows. I will tackle this more properly once everything is done for pyfftlog.

You can test if there is a significant difference in speed or not.

prisae commented 4 years ago

OK, @JesusTorrado , you should all be set.

Here the changelog-blurb:

First packaged release on PyPi and conda-forge. This includes:

JesusTorrado commented 4 years ago

Hi @prisae

I am very sorry for the months-long delay (I needed to drop this to finish other urgent things). Thanks a lot for the packaging! Works like a charm and it will make distributing my code so much easier!

I have tested your py vs non-py fftlog against each other a bit. In my case, I am running fhti and then fhtq. The first one is equally fast in both cases, whereas fhtq is 2-3x faster for my use case (and it did pip-install fine on my Ubuntu 18.04).

Thanks again!

PS: Also, fantastic documentation!

prisae commented 4 years ago

No problem @JesusTorrado , and I am glad it worked for you! And thanks for the push to package it, that was great.

Just out of curiosity, which one is 2-3x faster, fftlog or pyfftlog?

JesusTorrado commented 4 years ago

fftlog.

Thanks to you!

prisae commented 4 years ago

Yes, that is what I thought and makes sense. Thanks for confirming!

prisae commented 4 years ago

I'd like to make use of it in some code I plan to distribute

Do you distribute your package already? Mind posting a link here? I would be interested to have a look.

JesusTorrado commented 4 years ago

Not yet. It's not going to be a python package, but a full pipeline that will very likely be released together with my next paper. I let you know here when it's out!