Skip to content

Conversation

@seisman
Copy link
Member

@seisman seisman commented Jan 24, 2026

@seisman seisman added this to the 0.19.0 milestone Jan 24, 2026
@seisman seisman added maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog needs review This PR has higher priority and needs review. labels Jan 24, 2026
@seisman seisman marked this pull request as ready for review January 24, 2026 06:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates Figure.basemap’s box handling to the newer alias system and refreshes deprecation/docstring text for scale/rose-related parameters.

Changes:

  • Add an explicit box parameter to Figure.basemap and route it through AliasSystem via -F.
  • Update basemap docstring wording/structure, including deprecation guidance toward higher-level APIs.
  • Tweak coast deprecation docstring text for the map_scale parameter.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
pygmt/src/basemap.py Introduces box as an explicit parameter (mapped to -F) and updates documentation/deprecation messaging.
pygmt/src/coast.py Minor docstring wording changes for deprecated map_scale.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 8 to 11
from pygmt.alias import Alias, AliasSystem
from pygmt.clib import Session
from pygmt.helpers import build_arg_list, fmt_docstring, use_alias
from pygmt.params.box import Box
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Importing Box directly from pygmt.params.box is inconsistent with the rest of the codebase, which imports parameter classes from the pygmt.params package (e.g., pygmt/src/colorbar.py:from pygmt.params import Box). Prefer from pygmt.params import Box for consistency and to keep the public re-export as the canonical import path.

Copilot uses AI. Check for mistakes.
Use the ``box`` parameter in :meth:`pygmt.Figure.scalebar`,
:meth:`pygmt.Figure.directional_rose`, or :meth:`pygmt.Figure.magnetic_rose`
instead. This parameter is maintained for backward compatibility and accepts
raw GMT CLI strings for the ``-F`` option.
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The box parameter is typed as Box | str | bool, but its deprecation note says it only accepts raw GMT CLI strings for -F. Either document that Box instances are supported here (and how they map to -F modifiers), or remove Box from the accepted types to avoid a doc/API mismatch.

Suggested change
raw GMT CLI strings for the ``-F`` option.
either a :class:`~pygmt.params.box.Box` instance or raw GMT CLI strings for
the ``-F`` option.

Copilot uses AI. Check for mistakes.
Comment on lines 24 to 27
compass: str | None = None,
rose: str | None = None,
box: Box | str | bool = False,
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new public box parameter (including the new Box type) is introduced for Figure.basemap, but pygmt/tests/test_basemap.py doesn't cover it. Add at least one test that passes box=Box(...) (and ideally also checks the deprecated short-form F=... path) to prevent regressions in the alias migration.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Boring but important stuff for the core devs needs review This PR has higher priority and needs review. skip-changelog Skip adding Pull Request to changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants