Skip to content

Commit a1aee23

Browse files
author
niklasmueboe
committed
memory improvement through lazyframe usage
1 parent 0298ca4 commit a1aee23

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ovrlpy/_kde.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,10 @@ def _sample_expression(
203203
assert len(coord_columns) == 3 or len(coord_columns) == 2
204204

205205
# lower resolution instead of increasing bandwidth!
206-
transcripts = transcripts.select(
207-
(pl.col(c) / kde_bandwidth for c in coord_columns), gene_column
206+
transcripts = (
207+
transcripts.lazy()
208+
.select(pl.col(coord_columns) / kde_bandwidth, gene_column)
209+
.collect(engine="streaming")
208210
)
209211

210212
print("determining pseudocells")

0 commit comments

Comments
 (0)