Closed rkim48 closed 3 months ago
I think @alejoe91 will have to comment on this and maybe @magland. There has been work to provide a smooth translation layer for sortingview and the newer spikeinterface curation, but maybe something was missed. Is an update required in sortingview @magland? Or do we need to start troubleshooting the translation functions?
Here are the relevant packages and their versions. spikeinterface 0.101.0 kachery_cloud 0.4.9 sortingview 0.13.5
Some interesting observations while testing different conditions: 1) When I go to the generated sortingview url, only label units as accepted or rejected (no merging), save as snapshot and pass URI into the apply_sortingview_curation, I get the KeyError. 2) However, when I go back to sortingview and merge two random units, with the same following steps, I get no error. 3) Then, when I unmerge those two units, I get a different error: ValueError: Curation format: some labeled units are not in the unit list
I think that last error is something to do with a mismatch between the labeled_unit_set and unit_set types in curation_format/validate_curation_dict.
A quick fix for 1) is to check if the key exists and if not initialize as empty list into convert_from_sortingview_curation_format_v0:
assert destination_format == "1"
>>> if "mergeGroups" not in sortingview_dict.keys():
>>> sortingview_dict["mergeGroups"] = []
merge_groups = sortingview_dict["mergeGroups"]
That fixes the KeyError issue (1) but now I get ValueError (3).
Thanks @rkim48, I think we have to wait. @samuelgarcia implemented the translation functionality, but I also wanted to ping the others who know sortingview way better than I do. So I think we just wait for them to respond!
@zm711 Sure thing. I opened a pull request. Hopefully that makes things a little easier.
Edit: I think the PR is ready to be reviewed.
Hello, I just updated Spikeinterface from 0.100.2 to 0.101.0 and am making the transition to using sorting analyzer class which has been pretty smooth for the most part but I'm getting an error related to sortingview_curation. Here's my code:
However, apply_sortingview_curation throws me a KeyError.
Printing curation_dict returns this:
The curation dict is returned from kcl.load_json function from sortingview_curation.py:
Is there a reason why kcl.load_json isn't returning a curation_dict with the correct format?
Also, thank you guys for doing a great job with SpikeInterface. It's been a pleasure working with it.