Skip to content

Commit

Permalink
Use module-level logger in transforms.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Altay Sansal committed Nov 20, 2024
1 parent d82b930 commit 328b69a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/segy/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from numpy.typing import DTypeLike
from numpy.typing import NDArray


logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -165,7 +166,7 @@ class ByteSwapTransform(Transform):
def __init__(self, target_order: Endianness) -> None:
super().__init__()
self.target_order = target_order
logging.debug("Converting to %s endian.", self.target_order.value)
logger.debug("Converting to %s endian.", self.target_order.value)

def transform(self, data: NDArray[Any]) -> NDArray[Any]:
"""Byte swap numpy array given target order."""
Expand Down Expand Up @@ -196,7 +197,7 @@ class IbmFloatTransform(Transform):
def __init__(self, direction: str, keys: list[str] | None = None) -> None:
super().__init__(keys)
self.direction = direction
logging.debug("Converting to %s.", self.direction)
logger.debug("Converting %s.", self.direction)

def transform(self, data: NDArray[Any]) -> NDArray[Any]:
"""Convert floats between IEEE and IBM."""
Expand Down Expand Up @@ -285,7 +286,7 @@ def create(
"""Create an instance of transformation and return it."""
if transform_type not in cls.transform_map:
msg = f"Unsupported transformation type: {transform_type}"
logging.error(msg)
logger.error(msg)
raise KeyError(msg)

return cls.transform_map[transform_type](*args, **kwargs)
Expand Down

0 comments on commit 328b69a

Please sign in to comment.