MetaCell / nwb-explorer

NWB Explorer is a web application to visualise and analyse the content of NWB:N 2 files
Other
22 stars 16 forks source link

Bulk testing NWB files' compatibility with NWBE #308

Closed anhknguyen96 closed 8 months ago

anhknguyen96 commented 1 year ago

Right now, in order to know if a file can be loaded and interacted with on NWBE, one has to launch NWBE, copy-paste the file's URL to NWBE, wait for the webapp to load and until then try to plot the data. At any of these steps, failure can occur without clear indications to a cause or an error log to debugging.

As my aim is to bulk test NWB files' compatibility with NWBE, which is within the scope of this GSoC project, I would like to seek support on how to go about this efficiently. As far as I understand, assuming the webapp's frontend works seamlessly, incompatibilities can arise when (1) pynwb reads an nwb file and (2) the nwb file is converted to a geppetto model. If that's the case, is there a possibility of leveraging the python backend code of the webapp, or for example, a modified version of the repo's test section?

sanjayankur31 commented 1 year ago

@filippomc : what do you think, we should be able to use/re-use some code to do such tests without launching the full webapp?

filippomc commented 1 year ago

Hi @anhknguyen96, I agree that using the code you see test section is a good starting point and will cover most of the errors you'll see during nwb file loading

anhknguyen96 commented 1 year ago

Hi @filippomc , if my test flow is opening/loading a nwb -> creating a geppetto model interpreter for that nwb file -> testing if data is suitable for plotting with the existing plot functions in nwbe, and assuming that this test flow covers most of the errors, would a modified version of this test function work? If so, a follow-up question: what should I replace 'DUMMY' and 'whatever' with to make the importType valid? I imagine you wanted to test the code, not the files, so the specificity of the arguments wasn't your concern?

filippomc commented 1 year ago

Hey @anhknguyen96

The url parameter (DUMMY) is not used so can put any value there -- see also https://github.com/MetaCell/nwb-explorer/blob/ca06d267d36eb179c34433b64483d3c80ee32d29/nwb_explorer/nwb_model_interpreter/nwb_model_interpreter.py#L62

The second parameter (whatever) is the base path of the nwb file content -- see also https://github.com/MetaCell/nwb-explorer/blob/ca06d267d36eb179c34433b64483d3c80ee32d29/nwb_explorer/nwb_model_interpreter/nwb_geppetto_mappers.py#L147. Any name is ok, default is "nwbfile". The only use of this name is as base path for importValue, which actually is used to import data dynamically (eg timeseries). So paths by defaults will look like "nwbfile.acquisition..."

pgleeson commented 8 months ago

Live here: https://github.com/OpenSourceBrain/DANDIArchiveShowcase/blob/main/validation_folder/README.md