Skip to content

Conversation

@yvonnefroehlich
Copy link
Member

@yvonnefroehlich yvonnefroehlich commented Dec 17, 2025

Description of proposed changes

Use the plural units if the units of multiple quanities can be adjusted; related to #2014.

Preview:

Guidelines

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash command is:

  • /format: automatically format and lint the code

@yvonnefroehlich yvonnefroehlich added this to the 0.18.0 milestone Dec 17, 2025
@yvonnefroehlich yvonnefroehlich self-assigned this Dec 17, 2025
@yvonnefroehlich yvonnefroehlich added the deprecation Deprecating a feature label Dec 17, 2025
@fmt_docstring
@use_alias(E="dpi", F="scaling", I="inverse", M="unit", n="interpolation")
@deprecate_parameter("unit", "units", "v0.18.0", remove_version="v0.20.0")
@use_alias(E="dpi", F="scaling", I="inverse", M="units", n="interpolation")
Copy link
Member

Choose a reason for hiding this comment

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

I think it should be unit, not units, since it takes one single unit in this module.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was wondering it it makes sense to have this consistent across function / methods and always use plural.

Copy link
Member

Choose a reason for hiding this comment

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

I think we should use unit and units in different cases.

Copy link
Member Author

Choose a reason for hiding this comment

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

So, we only want to change pygmt.project?

@yvonnefroehlich yvonnefroehlich changed the title Deprecate parameter unit to units (Will be removed in v0.20.0) pygmt.project: Deprecate parameter unit to units (Will be removed in v0.20.0) Dec 17, 2025
@seisman
Copy link
Member

seisman commented Dec 17, 2025

Specify that x, y, r, s are in degrees while p, q, dist, lmin, lmax, wmin, wmax are in km. If -Q is not set, then all these are assumed to be in the same units.

Actually, I feel aliasing -Q to unit is a mistake. GMT.jl and GMT use km instead, but I feel km is also not a good name.

@yvonnefroehlich yvonnefroehlich marked this pull request as draft December 17, 2025 09:25
@yvonnefroehlich
Copy link
Member Author

Specify that x, y, r, s are in degrees while p, q, dist, lmin, lmax, wmin, wmax are in km. If -Q is not set, then all these are assumed to be in the same units.

Actually, I feel aliasing -Q to unit is a mistake. GMT.jl and GMT use km instead, but I feel km is also not a good name.

I have to look at this in more detail, as I do not use pygmt.project often. But agree km is not optimal as a name. Converted the PR to draft.

@seisman seisman modified the milestones: 0.18.0, 0.19.0 Dec 20, 2025
@seisman seisman removed this from the 0.19.0 milestone Jan 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deprecation Deprecating a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants