edgebundle icon indicating copy to clipboard operation
edgebundle copied to clipboard

migrate hammer bundle from python to c++

Open schochastics opened this issue 4 years ago • 11 comments

datashader is too big of a library to depend on. A re-implementation of the algorithm may be a good idea
code: https://datashader.org/_modules/datashader/bundling.html
original: https://gitlab.com/ianjcalvert/edgehammer

schochastics avatar Dec 16 '20 07:12 schochastics

hammer bundle in the example codes never worked on my machine. it is always Error: C stack usage 17587454638400 is too close to the limit

the other two work fine. thank you for your fantastic job.

duleise avatar Jan 20 '21 12:01 duleise

could you share a reproducible example?

schochastics avatar Jan 20 '21 13:01 schochastics

it’s exactly the codes in your blogpost. everything worked fine until it’s stuck at the hammer bundle.

20 jan. 2021 kl. 14:46 skrev David Schoch [email protected]:



could you share a reproducible example?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fschochastics%2Fedgebundle%2Fissues%2F3%23issuecomment-763615249&data=04%7C01%7Cotto.bergman%40ki.se%7C2b99e6441e01487de67108d8bd49bbb7%7Cbff7eef1cf4b4f32be3da1dda043c05d%7C0%7C0%7C637467471670216161%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=XGyJVafXC%2BO0jZfs4fkr5F7FST3wcq03%2F98XAUrDJC8%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABCUVQFH6LBTN2K74HCBPWLS23NBXANCNFSM4U5R3V7A&data=04%7C01%7Cotto.bergman%40ki.se%7C2b99e6441e01487de67108d8bd49bbb7%7Cbff7eef1cf4b4f32be3da1dda043c05d%7C0%7C0%7C637467471670226149%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9ePV3Fi1YE8RG4ThW8FDfkN9MgPd56w%2FGQxRLU1T4Mo%3D&reserved=0.

När du skickar e-post till Karolinska Institutet (KI) innebär detta att KI kommer att behandla dina personuppgifter. Här finns information om hur KI behandlar personuppgifterhttps://ki.se/medarbetare/integritetsskyddspolicy.

Sending email to Karolinska Institutet (KI) will result in KI processing your personal data. You can read more about KI’s processing of personal data herehttps://ki.se/en/staff/data-protection-policy.

duleise avatar Jan 20 '21 17:01 duleise

hmm I think I cannot do much about that. The main lifting is done in a python library I have no influence on. Maybe this helps: https://stackoverflow.com/questions/14719349/error-c-stack-usage-is-too-close-to-the-limit

Just another motivation to implement it myself to be able to deal with these kind of problems.

schochastics avatar Jan 20 '21 19:01 schochastics

I'm having some trouble with the internals of the hammer bundling. I can try to send you my graph object if that would be helpful.

Error in py_call_impl(callable, dots$args, dots$keywords) : ValueError: You are trying to merge on float64 and object columns. If you wish to proceed you should use pd.concat

tomauer avatar Jan 25 '21 21:01 tomauer

Yes if you can send me the graph object i will have a look

schochastics avatar Jan 28 '21 08:01 schochastics

Here's an RDS of my graph. I've been using the sfnetwork package to transform spatial data to a graph object and then casting (igraph::as.igraph()) when I call edge_bundle_hammer().

graph.rds.zip

tomauer avatar Jan 28 '21 14:01 tomauer

xy.rds.zip

Just realized you need the xy too.

tomauer avatar Jan 28 '21 14:01 tomauer

I am afraid that this is a problem of the python code that is called. So I cannot fix this issue. Yet another reason to implement it myself. I looked at the network a bit and the issue might be that they are all just paths. Did you try the other two edge bundling algorithms?

schochastics avatar Jan 28 '21 16:01 schochastics

I did. Maybe because they're just paths, I could never make the force-directed look good. The stub failed too, but is unappealing to me.

tomauer avatar Jan 28 '21 16:01 tomauer

From looking at the network a bit, I think any edge bundling will fail to produce something appealing. The structure seems too weird. (But I feel like the stub one always produces bad results irregardless of the input)

schochastics avatar Jan 28 '21 17:01 schochastics