Skip to content

Commit

Permalink
grdinfo workaround for GMT<=6.5 only
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Dec 4, 2024
1 parent 9af6b9c commit c707331
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pygmt/src/grdinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
grdinfo - Retrieve info about grid file.
"""

from pygmt.clib import Session
from packaging.version import Version
from pygmt.clib import Session, __version__
from pygmt.helpers import (
GMTTempFile,
build_arg_list,
Expand Down Expand Up @@ -111,7 +112,7 @@ def grdinfo(grid, **kwargs):
A string with information about the grid.
"""
# Workaround for upstream bug https://github.com/GenericMappingTools/gmt/issues/8525
grid_as_matrix = bool(kwargs.get("L"))
grid_as_matrix = Version(__version__) <= Version("6.5.0") and bool(kwargs.get("L"))

with GMTTempFile() as outfile:
with Session(grid_as_matrix=grid_as_matrix) as lib:
Expand Down

0 comments on commit c707331

Please sign in to comment.