@@ -68,7 +68,7 @@ def header_scan_worker(
6868 trace_range : tuple [int , int ],
6969 subset : list [str ] | None = None ,
7070) -> HeaderArray | tuple [HeaderArray , tuple [int , int , int ]]:
71- """Header scan worker with optional checksum calculation .
71+ """Header scan worker that calculates CRC32C checksum .
7272
7373 If SegyFile is not open, it can either accept a path string or a handle that was opened in
7474 a different context manager.
@@ -77,11 +77,9 @@ def header_scan_worker(
7777 segy_file_kwargs: Arguments to open SegyFile instance.
7878 trace_range: Tuple consisting of the trace ranges to read.
7979 subset: List of header names to filter and keep.
80- calculate_checksum: If True, also calculate CRC32C for this trace range.
8180
8281 Returns:
83- HeaderArray if calculate_checksum is False, otherwise tuple of (HeaderArray, checksum_info)
84- where checksum_info is (byte_offset, crc32c, byte_length).
82+ Tuple of (HeaderArray, checksum_info) where checksum_info is (byte_offset, crc32c, byte_length).
8583 """
8684 print ("Using header_scan_worker from checksum.py" )
8785 segy_file = SegyFile (** segy_file_kwargs )
@@ -135,19 +133,17 @@ def parse_headers( # noqa: PLR0913
135133 block_size : int = 10000 ,
136134 progress_bar : bool = True ,
137135) -> HeaderArray | tuple [HeaderArray , int ]:
138- """Read and parse given `byte_locations` from SEG-Y file.
136+ """Read and parse SEG-Y file headers and calculate CRC32C checksum .
139137
140138 Args:
141139 segy_file_kwargs: SEG-Y file arguments.
142140 num_traces: Total number of traces in the SEG-Y file.
143141 subset: List of header names to filter and keep.
144142 block_size: Number of traces to read for each block.
145143 progress_bar: Enable or disable progress bar. Default is True.
146- calculate_checksum: If True, also calculate CRC32C checksum for all trace data.
147144
148145 Returns:
149- HeaderArray if calculate_checksum is False.
150- Tuple of (HeaderArray, combined_crc32c) if calculate_checksum is True.
146+ Tuple of (HeaderArray, combined_crc32c) with the CRC32C checksum.
151147 """
152148 # Dynamically import the appropriate header_scan_worker based on checksum requirement
153149 # if should_calculate_checksum() and is_checksum_available():
@@ -267,9 +263,6 @@ def calculate_bytes_crc32c(data: bytes) -> int:
267263
268264 Returns:
269265 CRC32C checksum as integer.
270-
271- Raises:
272- ImportError: If checksum libraries are not available.
273266 """
274267 require_checksum_libraries ()
275268
@@ -286,9 +279,6 @@ def create_distributed_crc32c(initial_bytes: bytes, total_length: int) -> Distri
286279
287280 Returns:
288281 DistributedCRC32C instance.
289-
290- Raises:
291- ImportError: If checksum libraries are not available.
292282 """
293283 require_checksum_libraries ()
294284
@@ -309,7 +299,6 @@ def finalize_distributed_checksum(
309299
310300 Raises:
311301 ValueError: If checksum finalization fails.
312- ImportError: If checksum libraries are not available.
313302 """
314303 require_checksum_libraries ()
315304
0 commit comments