Skip to content

Commit

Permalink
Fix segy_revision dtype check in transform method
Browse files Browse the repository at this point in the history
Updated the transform method to check for the presence of the 'segy_revision' field in the data's dtype. This ensures compatibility with data structures that may not contain the 'segy_revision' key.
  • Loading branch information
Altay Sansal committed Sep 12, 2024
1 parent b3d6d39 commit b53579b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/segy/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def __init__(self) -> None:

def transform(self, data: NDArray[Any]) -> NDArray[Any]:
"""Assume Rev1 parsed major and update minor if major is 2."""
if data["segy_revision"] == 0:
if "segy_revision" not in data.dtype.names:
return data

major = SegyStandard(data["segy_revision"] // 256)
Expand Down

0 comments on commit b53579b

Please sign in to comment.