Repository navigation
fix(tl): sliding_window overlap columns as bool, not object - #1327
Open
selmanozleyen wants to merge 3 commits into
Open
selmanozleyen wants to merge 3 commits into
selmanozleyen wants to merge 3 commits into
Conversation
With overlap > 0, each window column is built by a .loc enlargement that sets True on the window's cells and leaves NaN elsewhere, an object column; fillna(False) keeps it object. Cast to bool, and assert the dtype in the existing overlap test.
selmanozleyen
force-pushed
the
fix/sliding-window-bool-columns
branch
from
October 27, 2026 20:37
b6fc514 to
e5296c9
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
overlap > 0,tl.sliding_windowwrites one membership column per window. Each column is built by a.locenlargement that setsTrueon the window's cells and leavesNaNelsewhere. That makes anobjectcolumn, andfillna(False)keeps itobject. So users getobjectcolumns of Python bools rather thanboolcolumns: about 8× the memory per column, and slower reductions over many windows.Fix:
.astype(bool)after thefillna. The window assignments are unchanged; only the dtype differs. The existing overlap test now assertsbool(it fails onmain, passes here).Found while benchmarking: comparing outputs across branches flagged the overlap columns as different, and the difference turned out to be only their dtype.