Repository: LibertyAces/BitSwanPump

Issue:
[TimeWindowMatrix] close_row() got an unexpected keyword argument 'clear'

Discussion:

Patch:
diff --git a/bspump/matrix/matrix.py b/bspump/matrix/matrix.py
index cd5929e9..78c8e035 100644
--- a/bspump/matrix/matrix.py
+++ b/bspump/matrix/matrix.py
@@ -218,8 +218,8 @@ class NamedMatrix(Matrix):
 		return row_index
 
 
-	def close_row(self, row_index: int):
-		super().close_row(row_index)
+	def close_row(self, row_index, clear=True):
+		super().close_row(row_index, clear=clear)
 
 		row_name = self.I2NMap.pop(row_index)
 		del self.N2IMap[row_name]


Test patch:
diff --git a/test/analyzer/test_time_window_matrix.py b/test/analyzer/test_time_window_matrix.py
index 5b663f46..8f8f3e9f 100644
--- a/test/analyzer/test_time_window_matrix.py
+++ b/test/analyzer/test_time_window_matrix.py
@@ -1,7 +1,4 @@
-import unittest
 import time
-import numpy as np
-import asab.abc.singleton
 
 import bspump
 import bspump.analyzer
@@ -45,6 +42,16 @@ class TestTimeWindowMatrix(bspump.unittest.TestCase):
 		row_index = matrix.add_row("abc")
 		self.assertEqual(matrix.Array.shape[0], matrix.WarmingUpCount.shape[0])
 
+
+	def test_matrix_close_row(self):
+		matrix = bspump.analyzer.TimeWindowMatrix(app=self.App, columns=3, clock_driven=False)
+		row_index = matrix.add_row("abc")
+		self.assertFalse(row_index in matrix.ClosedRows)
+		matrix.close_row(row_index)
+		self.assertTrue(row_index in matrix.ClosedRows)
+		matrix.flush()
+		self.assertEqual(0, matrix.Array.shape[0])
+
 	
 	def test_matrix_get_column(self):
 		columns = 10