diff --git a/spynnaker/pyNN/extra_algorithms/redundant_packet_count_report.py b/spynnaker/pyNN/extra_algorithms/redundant_packet_count_report.py index bf197617f2..85a4175e1c 100644 --- a/spynnaker/pyNN/extra_algorithms/redundant_packet_count_report.py +++ b/spynnaker/pyNN/extra_algorithms/redundant_packet_count_report.py @@ -92,8 +92,8 @@ def redundant_packet_count_report() -> None: def _create_views() -> None: with ProvenanceWriter() as db: - db.execute(REDUNDANCY_BY_CORE) - db.execute(REDUNDANCY_SUMMARY) + db.cursor().execute(REDUNDANCY_BY_CORE) + db.cursor().execute(REDUNDANCY_SUMMARY) def _write_report(output: TextIO): diff --git a/spynnaker/pyNN/utilities/neo_buffer_database.py b/spynnaker/pyNN/utilities/neo_buffer_database.py index 5fef01efcb..e859ab5014 100644 --- a/spynnaker/pyNN/utilities/neo_buffer_database.py +++ b/spynnaker/pyNN/utilities/neo_buffer_database.py @@ -147,7 +147,7 @@ def write_segment_metadata(self) -> None: The database must be writable for this to work! """ # t_stop intentionally left None to show no run data - self.execute( + self.cursor().execute( """ INSERT INTO segment( simulation_time_step_ms, segment_number, rec_datetime, @@ -170,7 +170,7 @@ def write_t_stop(self) -> None: The database must be writable for this to work! """ t_stop = SpynnakerDataView.get_current_run_time_ms() - self.execute( + self.cursor().execute( """ UPDATE segment SET t_stop = ? @@ -187,7 +187,7 @@ def __get_segment_info(self) -> Tuple[int, datetime, float, float, str]: ~spinn_front_end_common.utilities.exceptions.ConfigurationException: If the recording metadata not setup correctly """ - for row in self.execute( + for row in self.cursor().execute( """ SELECT segment_number, rec_datetime, t_stop, dt, simulator FROM segment @@ -215,7 +215,7 @@ def __get_simulation_time_step_ms(self) -> float: :rtype: float :return: The timestep """ - for row in self.execute( + for row in self.cursor().execute( """ SELECT simulation_time_step_ms FROM segment @@ -244,14 +244,14 @@ def __get_population_id( the population to record for :return: The ID """ - for row in self.execute( + for row in self.cursor().execute( """ SELECT pop_id FROM population WHERE label = ? LIMIT 1 """, (pop_label,)): return row["pop_id"] - self.execute( + self.cursor().execute( """ INSERT INTO population( label, first_id, description, pop_size) @@ -294,7 +294,7 @@ def __get_recording_id( :param int n_colour_bits: :return: The ID """ - for row in self.execute( + for row in self.cursor().execute( """ SELECT rec_id FROM recording_view WHERE label = ? AND variable = ? @@ -306,7 +306,7 @@ def __get_recording_id( data_type_name = data_type.name else: data_type_name = None - self.execute( + self.cursor().execute( """ INSERT INTO recording( pop_id, variable, data_type, buffered_type, t_start, @@ -336,7 +336,7 @@ def get_population_metadata( ~spinn_front_end_common.utilities.exceptions.ConfigurationException: If the recording metadata not setup correctly """ - for row in self.execute( + for row in self.cursor().execute( """ SELECT pop_size, first_id, description FROM population @@ -361,7 +361,7 @@ def get_recording_populations(self) -> Tuple[str, ...]: :rtype: list(str) """ results = [] - for row in self.execute( + for row in self.cursor().execute( """ SELECT label FROM population @@ -412,7 +412,7 @@ def get_recording_variables(self, pop_label: str) -> Tuple[str, ...]: :return: List of variable names """ results: List[str] = [] - for row in self.execute( + for row in self.cursor().execute( """ SELECT variable FROM recording_view @@ -473,7 +473,7 @@ def __get_recording_metadata( ~spinn_front_end_common.utilities.exceptions.ConfigurationException: If the recording metadata not setup correctly """ - for row in self.execute( + for row in self.cursor().execute( """ SELECT rec_id, data_type, buffered_type, t_start, sampling_interval_ms, pop_size, units, n_colour_bits @@ -506,7 +506,7 @@ def __get_region_metadata(self, rec_id: int) -> Iterable[Tuple[ """ index = 0 # Need to put the rows in a list to get them to persist. - for row in list(self.execute( + for row in list(self.cursor().execute( """ SELECT region_id, recording_neurons_st, vertex_slice, base_key FROM region_metadata @@ -1412,7 +1412,7 @@ def clear_data(self, pop_label: str, variables: Names): variables = self.__clean_variables(variables, pop_label) region_ids = [] for variable in variables: - self.execute( + self.cursor().execute( """ UPDATE recording SET t_start = ? @@ -1422,7 +1422,7 @@ def clear_data(self, pop_label: str, variables: Names): WHERE label = ? AND variable = ?) """, (t_start, pop_label, variable)) - for row in self.execute( + for row in self.cursor().execute( """ SELECT region_id FROM region_metadata NATURAL JOIN recording_view @@ -1488,7 +1488,7 @@ def __write_metadata(self, population: Population, variable: str): base_key = vertex.get_virtual_key() else: base_key = None - self.execute( + self.cursor().execute( """ INSERT INTO region_metadata( rec_id, region_id, recording_neurons_st,