magland/sortingview

clean up sortingview python package

Closed this issue · 6 comments

A lot of the functionality in this repo is unused, and the part that is most recommended to be used is under "experimental". Needs a reorganization cleanup.

Per email from Kyu on 1/20/22, the main areas used by FrankLab are to be found in per https://github.com/LorenFrankLab/nwb_datajoint/blob/new_spikeinterface/src/nwb_datajoint/common/common_sortingview.py and and https://github.com/LorenFrankLab/nwb_datajoint/blob/new_spikeinterface/src/nwb_datajoint/common/sortingview_helper_fn.py

In the former, there's a note that sortingview requires an outdated format for recordings, i.e. loading the recording, wrapping it as a RecordingExtractor from the older SpikeExtractors, and then saving as an hdf5 file. I'm not sure if this is still the case or if we intend to do anything about this.

Altogether, these scripts make use of:

  • Defined in workspace.py:
    • Expected to have recording_ids[] and sorting_ids[] lists as members
    • Expected to have a .uri member
    • load_workspace() and create_workspace() (static methods, exposed at top level) (in the former case, there's also another file that exports this code statically)
    • get_recording_extractor()
    • get_sorting_extractor() (Expected to return an item from list)
    • add_recording()
    • add_sorting()
    • set_sorting_curation_authorized_users()
    • set_unit_metrics_for_sorting()
    • set_snippet_length()
    • precalculate()
    • experimental_spikesortingview() (obviously this will be renamed)
  • Defined in SortingExtractor:
    • get_unit_ids()
    • store_sorting_link_h5()
  • Defined in RecordingExtractor:
    • store_recording_link_h5()

Next steps are to write up some scripts to determine what those functions are currently doing, and then some tests to confirm that they continue working as currently during cleanup.

In the former, there's a note that sortingview requires an outdated format for recordings, i.e. loading the recording, wrapping it as a RecordingExtractor from the older SpikeExtractors, and then saving as an hdf5 file. I'm not sure if this is still the case or if we intend to do anything about this.

I think this is still the case. @magland and I will meet to discuss if and how the LabboxEphysRecording / Sorting should be updated.

Defined in workspace.py:

I neglected to mention that we also make use of get_curated_sorting_extractor() from workspace.py

@jsoules We'll keep the Workspace class intact as is. In other words the cleanup won't involve removing methods from Workspace.

@magland in that case, assuming the same is true of the Sorting/RecordingExtractors, the vast majority of this code will be untouched--looks like it'll basically be down to probably renaming the experimental_spikesortingview method.

There's a lot of extra stuff in the package that perhaps can be deleted.

Ah, sorry, I meant that almost all of the code that FrankLab is using will be untouched. There's definitely plenty of cleanup to do, but if that isn't in the Workspace class, we should have a mostly free hand.