Skip to content

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

Merged
seisman merged 14 commits into
masterfrom
fix/plot-A
Apr 12, 2025
Merged

seisman merged 14 commits into
masterfrom
fix/plot-A

Conversation

@seisman

@seisman seisman commented Jan 7, 2025

Copy link
Copy Markdown
Member

See #8645 for context.

Closes #8645.

@github-actions

github-actions Bot commented Jan 7, 2025 •

Copy link
Copy Markdown
Contributor

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)

Details

Added images

Modified images

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

Report last updated at commit 31e79ca

@remkos remkos left a comment

Copy link
Copy Markdown
Contributor

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

seisman commented Jan 7, 2025

Copy link
Copy Markdown
Member Author

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

remkos commented Jan 7, 2025 •

Copy link
Copy Markdown
Contributor

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

joa-quim commented Jan 7, 2025

Copy link
Copy Markdown
Member

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

seisman commented Jan 7, 2025

Copy link
Copy Markdown
Member Author

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

@joa-quim

joa-quim commented Jan 7, 2025

Copy link
Copy Markdown
Member

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

joa-quim commented Jan 7, 2025

Copy link
Copy Markdown
Member

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.

@Esteban82

Copy link
Copy Markdown
Member

Can this be merge?

@seisman

seisman commented Apr 9, 2025

Copy link
Copy Markdown
Member Author

Not yet. There are other modules (e.g., clip) that takes the same -A option.

@seisman seisman changed the title plot/plot3d: Simplify the -A syntax to -Ax|y plot/plot3d/clip: Simplify the -A syntax to -Ax|y Apr 9, 2025
@seisman

seisman commented Apr 11, 2025

Copy link
Copy Markdown
Member Author

I believe this PR is now ready for final review.

@joa-quim joa-quim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good.

@seisman
seisman merged commit 9a8769f into master Apr 12, 2025
@seisman
seisman deleted the fix/plot-A branch April 12, 2025 05:05
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

4 participants