Closed jasper-tms closed 3 years ago
Hi Jasper. Good catch! Perhaps there is a floating point issue with the coordinates for some node/connector links? 'z1': n.z - 40
makes the search window larger but I doubt that will slow things down - happy to make that change! A similar query is also made in push_new_root
- I will add the -40
for good measure there too.
Fixed with f6aa8c06429a0bf85f5894a667325a1f7368da0a. Will release a new version in the next couple days and close this issue afterwards.
Forgot about this. New version 2.0.4 was released a week ago.
This is me troubleshooting what seems to be a pretty narrow corner case, but thought I'd share because at the end of the day I do have a small code change to recommend that may help avoid this corner case for other users.
When attempting to
pymaid.delete_nodes
on some connectors, something was going wrong resulting anI printed out a bunch of stuff to see what was going on. I saw that posts that result in successful connector deletion look something like
but for the attempt that was failing, the post looked like
Clearly the difference is that
c_links
is empty, when I guess it shouldn't be. I see your comment here indicating that your method of getting connector link IDs is somewhat hacky because the catmaid API doesn't provide a clean way of getting these. I worked a few steps backwards and saw that indeed the server response here that was supposed to contain connector link IDs instead didn't. Here's the connectors part of one such response returned by that fetch command:You can see that connector ID
16597757
is in this response, but there are no links associated with it. I didn't investigate why sometimes connector IDs fail to be returned by this API endpoint, but I found a workaround that worked at least in this one instance: change this line from'z1': n.z
to'z1': n.z - 40
. After making this change, the connector link IDs were returned for this connector, and therefore connector deletion command succeeded. So yea, I don't know what exactly is going on here, but perhaps it would be good to make this small change in pymaid to possibly eliminate some corner case where the connector link IDs don't get returned. Or, if you know more about what's happening, perhaps you can see a better fix that deals with what's going on more appropriately.Unfortunately I may not be able to reproduce this bug anymore since I've now deleted this connector, and it's a rare occurrence.