-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
category: proposalproposed enhancements or new featuresproposed enhancements or new featurespriority: mediumnon-critical problem and/or affecting only a small set of usersnon-critical problem and/or affecting only a small set of users
Description
Problem
The current recording workflow requires the users to perform the following required steps manually, which can lead to errors and makes the workflow more complicated. Specifically, during recording the user needs to:
- Call
finalizeon a select set of types (NWBFile,DynamicTable) before ending a recording to make sure the recording is being completed correctly. - Make separate calls for
stopRecordingfor the I/O andfinalizefor the individual containers to finalize the I/O and the Containers - Ideally also clear the cache for
BaseRecordingDataobjects for allRegisteredTypeobjects (which is being added in Refactor howBaseRecordingDataobjects are managed for aquisition #190) when a recording is finished to avoid accidental reuse of invalidBaseRecordingDataobjects.
Goal
Ideally, a user should be able to finalize a recording via a single function call.
Proposed Approach
- Add a
finalizemethod toRegisteredTypeand callthis->clearRecordingDataCache()in the base implementation ofRegisteredType.finalizeto remove all theBaseRecordingDataobjects from the cache. This approach will:- Provide a standard interface, ensuring that all
RegisteredTypeobjects have a standardizedfinalizemethod (not just select types, e.g.,NWBFileandDynamicTable) - Provides a standard process for clearing the cached
BaseRecordingDataobjects used for recording to datasets
- Provide a standard interface, ensuring that all
- Add
BaseIO.m_recording_containersprotected property (and access methods). This will:- Provide users with a main
RecordingContainersobject for tracking all containers used for recording associated with a particularIOobject, so that a user doesn't need to manually create theRecordingContainersobject
- Provide users with a main
- Add
RegisteredType.initializefunction to add the object to theRecordingContainersobject of the I/O it is associated with. This approach will:- Ensure that all
RegistedTypeobjects that are being used for recording are automatically added to the correspondingRecordingContainersobject of the I/O backend. AllRegisteredTypeclasses already store their I/O object inthis->m_ioso they are already linked to the I/O and in this way would also be linked to theRecordingContaintersobject.
- Ensure that all
- Updated
RecordingContainersaccording to Update RecordingContainer to store RegisteredType #191 . This will:- Allow tracking of all
RegisteredTypeobjects used for recording, not just instanced ofContainer
- Allow tracking of all
- Add
RecordingContainers.finalizemethod to call finalize on all containers that it manages inRecordingContainers.m_containers. And updateBaseIO.stopRecording(andHDF5IO.stopRecording) to call the newm_recording_containers.finalize()function. This will:- Ensure that all
RegisteredTypeobjects that are used for recording with the I/O are being finalized
- Ensure that all
This approach would enhance robustness and simplify the recording workflow by:
- Remove the step of creating the
RecordingContainers - Ensure that all
RegisteredTypeobject used for recording are being automatically tracked - Ensure that all
RegisteredTypeobjects are being finalize when the recording is being stopped, and remove the need for manually callingfinalizeon the theRegisteredTypeobjects
Metadata
Metadata
Assignees
Labels
category: proposalproposed enhancements or new featuresproposed enhancements or new featurespriority: mediumnon-critical problem and/or affecting only a small set of usersnon-critical problem and/or affecting only a small set of users