Skip to content

Commit 60bfee9

Browse files
committed
Consolidate temporary pieces of code
1 parent a27ea21 commit 60bfee9

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/mdio/converters/segy.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@
1313
from segy.config import SegyHeaderOverrides
1414
from segy.standards.codes import MeasurementSystem as SegyMeasurementSystem
1515
from segy.standards.fields import binary as binary_header_fields
16-
from zarr import open_group as zarr_open_group
1716

1817
from mdio.api.io import _normalize_path
19-
from mdio.api.io import _normalize_storage_options
2018
from mdio.api.io import to_mdio
2119
from mdio.builder.schemas.chunk_grid import RegularChunkGrid
2220
from mdio.builder.schemas.chunk_grid import RegularChunkShape
@@ -587,7 +585,6 @@ def segy_to_mdio( # noqa PLR0913
587585
default_variable_name = mdio_template.default_variable_name
588586
# This is an memory-expensive and time-consuming read-write operation
589587
# performed in chunks to save the memory
590-
# NOTE: trace_data_crc32c was already calculated during header scanning phase
591588
blocked_io.to_zarr(
592589
segy_file_kwargs=segy_file_kwargs,
593590
output_path=output_path,
@@ -600,9 +597,10 @@ def segy_to_mdio( # noqa PLR0913
600597
if trace_data_crc32c is not None:
601598
# The trace_data_crc32c is now the full file CRC32C from DistributedCRC32C
602599
final_crc32c = trace_data_crc32c
600+
from mdio.api.io import _normalize_storage_options # noqa: PLC0415
603601

604602
storage_options = _normalize_storage_options(output_path)
605-
zarr_group = zarr_open_group(output_path.as_posix(), mode="a", storage_options=storage_options)
603+
zarr_group = zarr.open_group(output_path.as_posix(), mode="a", storage_options=storage_options)
606604
zarr_group.attrs.update(
607605
{
608606
"segy_input_crc32c": final_crc32c, # Store as integer, not hex string

0 commit comments

Comments
 (0)