Fix center Spread logic to work as intended instead of just returning one index

This commit is contained in:
Jedrzej Kosinski
2023-12-22 00:47:38 -06:00
parent bcc7fa385e
commit 2eebf83ff6
+1 -1
View File
@@ -144,7 +144,7 @@ class SparseSpreadMethod(SparseMethod):
if full_length-hint_length < 3:
return list(np.linspace(0, full_length-1, hint_length+1, endpoint=True, dtype=int))[:-1]
# otherwise, get linspace of 2 greater than needed, then cut off first and last
return list(np.linspace(0, full_length-1, hint_length, endpoint=True, dtype=int))[1:-1]
return list(np.linspace(0, full_length-1, hint_length+2, endpoint=True, dtype=int))[1:-1]
return ValueError(f"Unrecognized spread: {self.spread}")