Add support for saving each device to its own NWB file
close #978 close #2127
Review: afcd865d7 (NWB: Create separate NWB file for each device, 2024-08-06)
-
[x] The change in NWB_GenerateDeviceDescription should be its own commit. Does the test RoundTripDepStimsetsRecursionThroughSweep from shttps://github.com/AllenInstitute/MIES/issues/2198 then passes? If yes the commit message should say so.
-
[x] No new usages of
FindValueplease, GetRowIndex should be preferred. -
[x] Using chunked compression in NWB_PrepareExport needs also to be its own commit.
-
[x] CloseAllNWBFiles/CloseNWBFile need to have a NWB_ prefix.
-
[x] LoadMiesFolderFromPXP also own commit.
-
[x] ExportEpochsFromFileToDF:
last += 1???
Same in TestEpochRecreationShortNames.
Is that a generic error when using BSP_FirstAndLastSweepAcquired? If yes we should do
for(i = first; i <= last; i += 1)
instead of wildly adding +1.
6dfc14e27 (Fix: RecreateMissingSweepAndConfigWaves handle non-missing waves properly, 2024-08-08)
Nice find!
b159debd7 (AB: Move AnalysisBrowser file name generation for ReExport to own function, 2024-08-08)
Juup.
f531e385d (HistoricDataTest: Add test to export NWBv1 data through AnalysisBrowser, 2024-08-08)
Good!
While playing around I found out that the "already open check" in AB_AddExperimentEntries is not used when you D&D a file into IP as BeforeFileOpenHook uses AB_AddFile directly. Happy to table that after this PR if that is not new.
Regarding BSP_FirstAndLastSweepAcquired:
The function returns the last index inclusive.
Also the function has a bigger general issue that it is not multiple device aware. I think it actually should have a device argument and return the first / last sweep of that device. Returning that for multiple devices seems for me that it gives results that are not senseful usable anywhere.
Also the function has a bigger general issue that it is not multiple device aware. I think it actually should have a device argument and return the first / last sweep of that device. Returning that for multiple devices seems for me that it gives results that are not senseful usable anywhere.
Databrowsers can only be locked to one device so it works for them. And for Sweepbrowsers it can have duplicated sweep numbers for multiple devices yes.
TestEpochRecreationShortNames and the generator: I rewrote the the whole test and the generator to work properly with multiple devices loaded in the SB.
I also added two utility functions to the SB for that.
Most of the SB functions are single experiment / single device and will return wrong results/data for the multi case. Also e.g. SweepFormula that uses these functions does not work correctly then.
In #2109 we introduce that support through the select changes in SF but the SB API is still unaware of that. I would consider functions like
SF_GetSweepMapIndices to be more part of SB than of SF.