magland / sortingview

Web app for viewing results of ephys spike sorting
Apache License 2.0
25 stars 8 forks source link

Revisiting workspace list #71

Closed magland closed 3 years ago

magland commented 3 years ago

The workspace list for frank lab is getting a bit unwieldy, and I propose to update the system.

@lfrank @khl02007 Could you make a python script that queries your dj database and returns a flat list of workspaces with meta information? Then at the end of the script it would be something like this:

sortingview.set_workspaces(workspaces)

where workspaces is a list of workspace dicts each of the form:

{
  'workspaceUri': 'workspace://...',
  'label': 'workspace-name',
  'metaData': arbitrary meta information that you want to include (but must be json-able - and not huge)
}

Then on the web app, rather than getting a big list, you'd have a search bar, and you'd be able to see the meta data for the workspaces, as well as convenient access to recently opened workspaces.

the idea is that script would be run periodically, or whenever the database has been updated

Thoughts?

lfrank commented 3 years ago

I think that would be relatively straight forward; we just need to think about which meta data to include. The easiest way to do this would be to rerun it each time a new sorting is added. I'm not quite clear on how to include data that are json-able, though. Do you have an example of that?

magland commented 3 years ago

@lfrank, for now you don't need to include any meta data (maybe it's all encoded in the workspace name/label)

By json-able I just mean 'able to be serialized as json'. So, no numpy arrays or other Python objects that aren't simple strings, numbers, dicts, lists, etc.

There is a PR open on this (#72), and that will include a migrate script that will allow you to migrate from the existing workspace list in the interim.