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

plot/plot3d: Simplify the -A syntax to -Ax|y #8674

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

seisman
Copy link
Member

@seisman seisman commented Jan 7, 2025

See #8645 for context.

Closes #8645.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Summary of changed images

This is an auto-generated report of images that have changed on the DVC remote

Status Path
modified test/baseline/psxy/
modified test/baseline/psxy/polarcurves.ps

Image diff(s)

Added images

Modified images

Path Old New
test/baseline/psxy/polarcurves.ps

Report last updated at commit f2f3f7a

Copy link
Contributor

@remkos remkos left a comment

Choose a reason for hiding this comment

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

I felt I should review this since I implemented -Am and -Ap in GMT4 in Sep 2007!
Since then it was extended with -A[x|y|r|t], without it actually requiring a change of code except for needing to parse the options and add to the documentation.

So it is OK to me to bring it back to -A[x|y] as long as the old options are still supported for backward compatibility.

How does this impact the long options?

@seisman
Copy link
Member Author

seisman commented Jan 7, 2025

I felt I should review this since I implemented -Am and -Ap in GMT4 in Sep 2007!

Good to know the history dating back to 2007!

When updating the documentation, we also found a bug that the meaning of -Am and -Ap are reversed. Please see #8645 (comment) for details. We already fixed it in #8648, but it would be great if you can verify it again.

So it is OK to me to bring it back to -A[x|y] as long as the old options are still supported for backward compatibility.

Yes, it's backward compatible.

How does this impact the long options?

That's a good question. Currently, long names exist for m/p/x/y/r/t (

"m,p,x,y,r,t", "mpfollow,pmfollow,xyalong,yxalong,rtalong,tralong",
). I guess we should also remove the long names for m/p/r/t, OK?

@remkos
Copy link
Contributor

remkos commented Jan 7, 2025

The original implementation from 2007 was, according to the e-mail I found about it:

-Am : first follow meridian, then parallel
-Ap : first follow parallel, then meridian.

As I said, -Ax and -Ay came later, but clearly x and p should be equivalent, just as y and m. The code also has that equivalence correct. Clearly sometime later the GMT_STAIRS_X and GMT_STAIRS_Y got confused (maybe already at the introduction of those defines), but you fixed that in #8667 and @Esteban82 in #8648.

So with this PR (#8674) we are good.

Regarding the long options, since they have not been thoroughly introduced, I would keep only xyalong,yxalong.

@joa-quim
Copy link
Member

joa-quim commented Jan 7, 2025

I must have missed that longoption choice that missed to match any of GMT.jl options. I propose to rename it to stairs, steps.
xyalong also looks awful to me. Why not just x, y or, in longer, xfirst, yfirst?

@seisman
Copy link
Member Author

seisman commented Jan 7, 2025

In PyGMT, the parameter name is straight_line and valid values are True, x and y.

@joa-quim
Copy link
Member

joa-quim commented Jan 7, 2025

GMT.jl accepts steps, stairs and straight_lines, but last one is not documented (probably it was before) and I'll drop it.
To solve this we can have in GMT these three aliases steps, stairs & straight_line ... or you change the PyGMT keyword or add an alias.

@joa-quim
Copy link
Member

joa-quim commented Jan 7, 2025

Also -E longoptions got it all wrong GMT.jl has error_bars, PyGMT error_bar but GMT picked errorbars. Add all three aliases in master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

plot/plot3d: Simplify the documentation for the -A option
3 participants