Skip to content

Commit 5d38dbb

Browse files
committed
Eager free of valid_mask
1 parent a7ab60e commit 5d38dbb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/mdio/converters/segy.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,10 @@ def segy_to_mdio( # noqa: PLR0913, PLR0915
408408
logger.warning("Ingestion grid shape: %s.", grid.shape)
409409
raise GridTraceCountError(valid_count, num_traces)
410410

411+
import gc
412+
del valid_mask
413+
gc.collect()
414+
411415
if chunksize is None:
412416
dim_count = len(index_names) + 1
413417
if dim_count == 2: # noqa: PLR2004
@@ -456,7 +460,6 @@ def segy_to_mdio( # noqa: PLR0913, PLR0915
456460
# 'live_mask_array' has the same first N–1 dims as 'grid.shape[:-1]'
457461
# Build a ChunkIterator over the live_mask (no sample axis)
458462
from mdio.core.indexing import ChunkIterator
459-
import gc
460463

461464
chunker = ChunkIterator(live_mask_array, chunk_samples=True)
462465
for chunk_indices in chunker:

0 commit comments

Comments
 (0)