Skip to content

Commit

Permalink
Fix block unwrapping by adding early return check.
Browse files Browse the repository at this point in the history
  • Loading branch information
Altay Sansal committed Feb 4, 2025
1 parent 28c0344 commit 876c30e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/mdio/segy/blocked_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,11 @@ def to_segy(
# to first (slowest) dimension. End result will be the blocks with the
# size of the outermost dimension in ascending order.
consecutive_dim_index = find_trailing_ones_index(is_block_live.numblocks)

# Shortcut if no unwrapping necessary.
if consecutive_dim_index == 1:
return is_block_live.any(axis=-1)

while consecutive_dim_index != 1:
current_chunks = is_block_live.chunks

Expand Down

0 comments on commit 876c30e

Please # to comment.