Skip to content

Commit

Permalink
remove pass through kwargs methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Dec 16, 2024
1 parent d31b9b1 commit a1071ff
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
32 changes: 16 additions & 16 deletions spynnaker/pyNN/utilities/neo_buffer_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 = ?
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 = ?
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 = ?
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit a1071ff

Please sign in to comment.