Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be consistent wihen limits can be set to ±infinity #8097

Open
PaulWessel opened this issue Nov 28, 2023 · 4 comments
Open

Be consistent wihen limits can be set to ±infinity #8097

PaulWessel opened this issue Nov 28, 2023 · 4 comments
Assignees
Labels
feature request Request a new feature
Milestone

Comments

@PaulWessel
Copy link
Member

We have a few modules (e.g., gmtselect, grdcut) that has a -Zmin/max type option. If we want to disable min or max (i.e., have no limits or ±infinity) then we are asked in some places to use a hyphen and in other places use NaN. My question to you are

  1. Do we select -, which is a troublesome letter in options?
  2. Do we select NaN, which we can easily detect even though it is not ±infinity which we dont parse for.

I think (2) is most sensible but we will of course honour the old syntax in a backwards compatible way.

@PaulWessel PaulWessel added the feature request Request a new feature label Nov 28, 2023
@PaulWessel PaulWessel added this to the 6.5.0 milestone Nov 28, 2023
@remkos
Copy link
Contributor

remkos commented Nov 28, 2023

From your options, I would go for options (2).

But in some of my own code (different project), I would allow things like

  • -Z/max, meaning no lower bound specified; would be the same as setting min to NaN.
  • -Zmin/, meaning no upper bound specified; would be the same as setting max to NaN.
  • -Z/, meaning setting no lower nor upper bound; would be the same as setting both min and max to NaN.

@anbj
Copy link
Contributor

anbj commented Nov 28, 2023

I guess this also applies to e.g. grdcontour’s -L?

@PaulWessel
Copy link
Member Author

Believe so, need to scan all modules for such options

@PaulWessel
Copy link
Member Author

From your options, I would go for options (2).

But in some of my own code (different project), I would allow things like

  • -Z/max, meaning no lower bound specified; would be the same as setting min to NaN.
  • -Zmin/, meaning no upper bound specified; would be the same as setting max to NaN.
  • -Z/, meaning setting no lower nor upper bound; would be the same as setting both min and max to NaN.

I believe we do have this somewhere in GMT as well. Will be painful to go through 150 modules to determine which ones have a min/max thingy with -, NaN, or empty...

@seisman seisman modified the milestones: 6.5.0, 6.6.0 Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request a new feature
Projects
None yet
Development

No branches or pull requests

5 participants