diff --git a/spynnaker/pyNN/models/recorder.py b/spynnaker/pyNN/models/recorder.py index 4375a0806d..94c0b4f9f2 100644 --- a/spynnaker/pyNN/models/recorder.py +++ b/spynnaker/pyNN/models/recorder.py @@ -323,7 +323,8 @@ def __append_previous_segment( ~spinn_front_end_common.utilities.exceptions.ConfigurationException: If the recording not setup correctly """ - with NeoBufferDatabase.segement_db(segment_number) as db: + with NeoBufferDatabase.segement_db( + segment_number, read_only=not clear) as db: if block is None: block = db.get_empty_block( self.__population.label, annotations) diff --git a/spynnaker/pyNN/utilities/neo_buffer_database.py b/spynnaker/pyNN/utilities/neo_buffer_database.py index 72f5816860..1086cad607 100644 --- a/spynnaker/pyNN/utilities/neo_buffer_database.py +++ b/spynnaker/pyNN/utilities/neo_buffer_database.py @@ -128,12 +128,13 @@ def __init__(self, database_file: Optional[str] = None, segment_cache[segment] = database_file @classmethod - def segement_db(cls, segment_number: int) -> NeoBufferDatabase: + def segement_db(cls, segment_number: int, + read_only: Optional[bool] = None) -> NeoBufferDatabase: """ Retrieves a NeoBufferDatabase for this segment. """ database_file = segment_cache[segment_number] - return NeoBufferDatabase(database_file) + return NeoBufferDatabase(database_file, read_only) def write_segment_metadata(self) -> None: """