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

Add longoptions support for gmtspatial. #8065

Merged
merged 8 commits into from
Nov 30, 2023
Merged

Add longoptions support for gmtspatial. #8065

merged 8 commits into from
Nov 30, 2023

Conversation

rbdavis
Copy link
Contributor

@rbdavis rbdavis commented Nov 23, 2023

Description of proposed changes

Python differences:

No python module.

Julia differences:

Used in_polygons for -N instead of in_polyg (awkward abbreviation
and inconsistent with -F force_polygons).

Used spatial for -S instead of polygons. Almost all options are
related to polygons, so using 'polygons' alone is not helpful in
distinguishing between them.

Fixes #8064

Reminders

  • Make sure that your code follows our style. Use the other functions/files as a basis.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Describe changes to function behavior and arguments in a comment below the function declaration.
  • If adding new functionality, add a detailed description to the documentation and/or an example.

@rbdavis rbdavis requested a review from a team November 23, 2023 02:20
Use factor instead of fact for clarity. Added missing +s description for -D documentation and added alias limits to range since latter is not good for PyGMT.

Rest looks fine to me.
Copy link
Member

@PaulWessel PaulWessel left a comment

Choose a reason for hiding this comment

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

See comments

@PaulWessel PaulWessel requested a review from a team November 23, 2023 10:25
@joa-quim
Copy link
Member

Well, I agree with your -S polygons comment that's all about polygons but that applies exactly to spatial. So not sure it's better, and the other name already exists.

{ 0, 'T', "",
"", "",
{ 0, 'S', "spatial",
"b,h,i,j,s,u", "buffer,hole,intersection,join,split,union",
Copy link
Member

Choose a reason for hiding this comment

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

The directives (some) are also different in Julia. GMT.jl has holes instead of hole and dateline instead of split. I think dateline is better because it clearly indicates where the split occurs.

Copy link
Member

Choose a reason for hiding this comment

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

Tend to agree with this. Could do alias holes here but I like dateline.

Copy link
Member

Choose a reason for hiding this comment

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

We can add alias holes but not that all the others are singular nouns so holes stand out.

Copy link
Member

Choose a reason for hiding this comment

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

Best if GMT.jl now adds the hole alias to match CLI. I did the dateline change and added alias holes.

@joa-quim
Copy link
Member

joa-quim commented Nov 24, 2023

Right, but what it detects are holes, not just one hole: The man construction and hole polygons is also a bit dubious (if I'm interpreting it correctly).

@PaulWessel
Copy link
Member

I see it is unclear. I will rephrase.

Improve documentation for -S directives.
@PaulWessel
Copy link
Member

I updated the -S documentation. Le the know if this is clearer:

doc

@joa-quim
Copy link
Member

Yes, much better. But now you raised me another doubt. What is meant by reverses them? You mean make them of opposite wise of the parent polygon (clockwise or counter-clockwise)?

@PaulWessel
Copy link
Member

Yes, much better. But now you raised me another doubt. What is meant by reverses them? You mean make them of opposite wise of the parent polygon (clockwise or counter-clockwise)?

Yes, any holes will get the opposite handedness as the parent (coco vs counter-clock). Il'' fix the docs for h to say

  • h identifies polygons that are holes of other polygons (and flags and reverses their handedness to be the opposite of the outer polygon).

Any other things before I add this?

@joa-quim
Copy link
Member

joa-quim commented Nov 24, 2023

No, sounds good.
(on my way to the train)

@PaulWessel
Copy link
Member

A bit dumb to list -Si, -Sj, -Su when not implemented (after many years). Leaves two options:

  1. Try to implement this (but cannot do so before 6.5 as it will take a while).
  2. Put those things under an #if 0 ...#endif so user dont read those and get confused.

Those directives were clearly aspirational but here we are... I think there is a C++ library out there but perhaps there is a C library somewhere we could use?

@rbdavis rbdavis merged commit 009e5b3 into master Nov 30, 2023
6 checks passed
@rbdavis rbdavis deleted the longopts-gmtspatial branch November 30, 2023 18:48
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.

Add longoptions support for gmtspatial.
3 participants