Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure ripser and all language bindings #10

Closed
sauln opened this issue Apr 23, 2018 · 11 comments
Closed

Restructure ripser and all language bindings #10

sauln opened this issue Apr 23, 2018 · 11 comments

Comments

@sauln
Copy link
Member

sauln commented Apr 23, 2018

This is a continuation of a conversation from mtsch/Ripser.jl#1

The current ripser+bindings ecosystem is a bit of a mess. We currently have multiple repositories and forks, all accomplishing different goals. I suggest we restructure the repos so that the ecosystem can grow smoothly. This current fork has diverged greatly from the original repository and I don't foresee us ever merging it back.

There is also intention to create Matlab bindings and to port the old Wasm bindings. @mtsch is working on C bindings that might simplify this whole process and enable many other languages.

There are probably a couple different ways we could do this. One that stands out to me would be to split this repo into 2, one with the modified cpp and the other with the Python bindings. Then all bindings repositories could point towards the cpp library. Only the cpp repo would be a fork of ripser, the rest would be standalone repos.

Ideally, we could put all repos under the @Ripser organization, but @ubauer would have to give everyone access to the organization.

@ctralie, @mtsch, what do you two think?

@ctralie
Copy link
Member

ctralie commented Apr 23, 2018

I like the idea of separating out the C++ code and keeping it as a fork of ripser, but honestly I would need to know more about the "C bindings" by @mtsch before I could be sure how I feel about it. What are the planned features there?
Thanks,
Chris

@mtsch
Copy link
Collaborator

mtsch commented May 8, 2018

Hello,

Sorry for taking so long, I was pretty busy and then I went away for a week. I had the chance to take a look at the code and from what I can see, the pythondm function is pretty much what I had in mind.
The only thing I'm not so sure about is storing lengths and indices as floats, but I don't really see a better way to do it.

I just need to add a function that transforms it into a C array and declare it as extern "C".

Cheers, Matija

@ctralie
Copy link
Member

ctralie commented May 8, 2018 via email

@mtsch
Copy link
Collaborator

mtsch commented May 9, 2018

I added the C thing for both the regular and sparse versions in #21.
About the outputs: do you maybe think it would be a good idea to return 4 arrays, one for the numbers of intervals in each dimension, one for the births and deaths, one for cocycle lengths and one for the cocycles. The C interface would then be something like int cripser(int** numperclass, float** birthsanddeaths, int** cocyclelength, int** cocycles, ...). The function would return the number of dimensions.
I'm not sure what the best way to do this is in C++ or how that works with Python, since I don't have a lot of experience with those.

@ctralie
Copy link
Member

ctralie commented May 9, 2018

Okay great! I merged that in, thanks.

One warning, though. I indeed got sparse matrices to work on that branch, but I seem to have broken cocycles. So I'm still working that out, which is why I haven't merged it to master yet. Luckily, this is something internal, and it shouldn't affect any of the code you've written. But careful using it until that's resolved.

Let me reach out to Uli Bauer again to see if he can help me fix the cocycles

@mtsch
Copy link
Collaborator

mtsch commented May 9, 2018

No worries about the cocycles, I haven't needed them yet and they were never available in my wrapper. I do plan on supporting them, but I have some major restructuring to do first.

By the way, huge thanks for doing this, it's gonna be really useful for me!

@ctralie
Copy link
Member

ctralie commented May 11, 2018

@mtsch @sauln should I close this issue?

Or should we continue the discussion? I think the code is setup now that very small entry point blocks can be added to support other languages. Not sure if you want to keep my fork as just a Python fork or have those other languages in the fork as well?

@mtsch
Copy link
Collaborator

mtsch commented May 12, 2018

I think it's better to have the bindings for different languages separated, or it could get messy. Either way, the Julia bindings need to be separate because Julia's package manager downloads code from Github directly and it requires a certain repo structure.
It would be perfect if the C++ code was separated from the bindings (or maybe merged into the main repo if Uli would have it), but I can live with the current solution as well. I would however propose a libripser branch that only includes the C++ part and a Makefile that builds a .so/.dll file. I can prepare a PR this week if you agree. Another nitpick is that we should probably rename the pythondm function to something else because it's not really Python specific.

Beside all that, It's looking great!

@ctralie
Copy link
Member

ctralie commented May 12, 2018 via email

@ctralie
Copy link
Member

ctralie commented May 14, 2018

Hi @mtsch, I'm going to try to resolve #25 in the next few days. Once I do that, the C++ code should be frozen for a while. That would be a good time to make a pull request.
Thanks,
Chris

@ctralie
Copy link
Member

ctralie commented May 19, 2018

@mtsch, I merged in the new cython wrappers to master because I need to make another branch for matlab that uses then. Could you make a pull request with the stuff you need?
Thanks,
Chris

@ctralie ctralie closed this as completed Jun 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants