Skip to content

Commit

Permalink
Refactor compute_global_index and update filepath generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Altay Sansal committed Feb 13, 2025
1 parent 52539ee commit 60ebb43
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/mdio/segy/blocked_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import os
from concurrent.futures import ProcessPoolExecutor
from itertools import repeat
from shutil import copyfileobj
from typing import TYPE_CHECKING

import numpy as np
Expand All @@ -21,6 +20,7 @@
from mdio.core.indexing import ChunkIterator
from mdio.segy._workers import trace_worker
from mdio.segy.creation import SegyPartRecord
from mdio.segy.creation import concat_files
from mdio.segy.creation import serialize_to_segy_stack
from mdio.segy.utilities import find_trailing_ones_index

Expand Down Expand Up @@ -249,11 +249,7 @@ def segy_record_concat(
dest_map[record_file_path].append(block.path)

for dest_path, source_paths in dest_map.items():
with open(dest_path, "wb") as dest_file:
for src_path in source_paths:
with open(src_path, "rb") as src_file:
copyfileobj(src_file, dest_file)
os.remove(src_path)
concat_files([dest_path] + source_paths)

return records_metadata

Expand Down

0 comments on commit 60ebb43

Please sign in to comment.