Open yarikoptic opened 3 years ago
Hi @yarikoptic thanks for the detailed analysis. Yes this is certainly related to the python console file loading.
A strategy can be to make a local copy of the downloaded file and use that copy for the Python console. Need to ensure that the Python console load starts after the dowload is complete
Relevant code parts:
Handle action file loading action from the frontend : https://github.com/MetaCell/nwb-explorer/blob/c7e45cd75970465a490e1dbdd20429ce31571fa4/webapp/redux/middleware/nwbMiddleware.js#L117
Trigger notebook load action: https://github.com/MetaCell/nwb-explorer/blob/c7e45cd75970465a490e1dbdd20429ce31571fa4/webapp/redux/middleware/nwbMiddleware.js#L133 The trigger must be changed, here we are not sure that the download was complete.
Backend entry point: https://github.com/MetaCell/nwb-explorer/blob/c7e45cd75970465a490e1dbdd20429ce31571fa4/nwb_explorer/nwb_main.py#L46
visiting http://nwbexplorer.opensourcebrain.org/nwbfile=https://datasets-dev.datalad.org/dandi/dandisets/000027/sub-RAT123/sub-RAT123.nwb and looking at apache logs, shows
with I guess first one to display details, and then 2nd one appears shortly after a spinner in Python tab stops spinning so - for that Python session? ... For a more sizeable http://nwbexplorer.opensourcebrain.org/nwbfile=https://datasets-dev.datalad.org/dandi/dandisets/000005/sub-anm184389/sub-anm184389_ses-20130207_behavior+ecephys.nwb - the same effect of two full 286MB download requests.
It seems that ideally it should be avoided, and a singular GET should be sufficient.