Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions pygmt/src/directional_rose.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
from collections.abc import Sequence
from typing import Literal

from packaging.version import Version
from pygmt._typing import AnchorCode
from pygmt.alias import Alias, AliasSystem
from pygmt.clib import Session, __gmt_version__
from pygmt.clib import Session
from pygmt.helpers import build_arg_list, fmt_docstring
from pygmt.params import Box, Position
from pygmt.src._common import _parse_position
Expand Down Expand Up @@ -84,15 +83,8 @@ def directional_rose(
"""
self._activate_figure()

# The default position is set to "TR" since GMT 6.7.0, which has no default value
# in GMT 6.6.0 and earlier versions.
# TODO(GMT>6.6.0): Set 'default=None' after GMT 6.7.0.
position = _parse_position(
position,
default=None
if Version(__gmt_version__) > Version("6.6.0")
else Position("TR", cstype="inside"),
)
# Set the default position to "TR" to be consistent with the behavior in GMT 6.7.0
position = _parse_position(position, default=Position("TR", cstype="inside"))

aliasdict = AliasSystem(
F=Alias(box, name="box"),
Expand Down
14 changes: 3 additions & 11 deletions pygmt/src/magnetic_rose.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
from collections.abc import Sequence
from typing import Literal

from packaging.version import Version
from pygmt._typing import AnchorCode
from pygmt.alias import Alias, AliasSystem
from pygmt.clib import Session, __gmt_version__
from pygmt.clib import Session
from pygmt.exceptions import GMTParameterError
from pygmt.helpers import build_arg_list, fmt_docstring
from pygmt.params import Box, Position
Expand Down Expand Up @@ -109,15 +108,8 @@ def magnetic_rose( # noqa: PLR0913
"""
self._activate_figure()

# The default position is set to "TR" since GMT 6.7.0, which has no default value
# in GMT 6.6.0 and earlier versions.
# TODO(GMT>6.6.0): Set 'default=None' after GMT 6.7.0.
position = _parse_position(
position,
default=None
if Version(__gmt_version__) > Version("6.6.0")
else Position("TR", cstype="inside"),
)
# Set the default position to "TR" to be consistent with the behavior in GMT 6.7.0
position = _parse_position(position, default=Position("TR", cstype="inside"))

if declination_label is not None:
if declination is None:
Expand Down
Loading