GenericMappingTools / pygmt

A Python interface for the Generic Mapping Tools.
https://www.pygmt.org
BSD 3-Clause "New" or "Revised" License
758 stars 220 forks source link

No aliases lists given in docs for some functions or methods #2185

Closed yvonnefroehlich closed 8 months ago

yvonnefroehlich commented 2 years ago

There are no aliases lists given in the documentation for the class pygmt.triangulate and its methods

Is this intended?


Edit (see comment by @weiji14 below): This is simliar for the class pygmt.grdhisteq and its methods pygmt.grdhisteq.compute_bins and pygmt.grdhisteq.equalize_grid.

seisman commented 2 years ago

Ping @weiji14

weiji14 commented 2 years ago

The regular_grid and delaunay_triples functions don't use the @use_alias decorator as seen here:

https://github.com/GenericMappingTools/pygmt/blob/e4e4c43946e43b7f03f10bfc7155d6e9f81cccfc/pygmt/src/triangulate.py#L151-L153

https://github.com/GenericMappingTools/pygmt/blob/e4e4c43946e43b7f03f10bfc7155d6e9f81cccfc/pygmt/src/triangulate.py#L277-L279

so the {aliases} shortcode won't work.

We could discuss whether it's worth spending time to add the alias list, though it would be quite involved I think (also considering the eventual goal is to drop single character aliases, xref #262).

What might be a better use of time is to wrap the remainder of the short parameters in https://docs.generic-mapping-tools.org/6.4/triangulate.html (e.g. -A, -C, etc) that don't yet have a long alias in PyGMT. The original implementation of triangulate at #731 was only meant to do a minimum set of these aliases.

P.S. The same issue also applies for https://www.pygmt.org/v0.7.0/api/generated/pygmt.grdhisteq.html

yvonnefroehlich commented 1 year ago

I apologize for my delayed response! Thanks @weiji14 for your explanation!

The regular_grid and delaunay_triples functions don't use the @use_alias decorator [...] so the {aliases} shortcode won't work.

Yes, I realized this, when I added the {aliases} short code and locally testing failed :wink:.

We could discuss whether it's worth spending time to add the alias list, though it would be quite involved I think (also considering the eventual goal is to drop single character aliases, xref #262).

I can not comment on how much effort adding the alias list would be. Could this be done in a general way and applied to all functions and methods which currently do not have an alias list in the documentation?

What might be a better use of time is to wrap the remainder of the short parameters in https://docs.generic-mapping-tools.org/6.4/triangulate.html (e.g. -A, -C, etc) that don't yet have a long alias in PyGMT. The original implementation of triangulate at #731 was only meant to do a minimum set of these aliases.

From a long-term perspective and considering the proposed goal to drop the single chracter aliases, I feel, as mention by @weiji14, it makes sense to prioritize wrapping the remainder of the short parameters.

P.S. The same issue also applies for https://www.pygmt.org/v0.7.0/api/generated/pygmt.grdhisteq.html

I adjusted the title of the issue and my initial comment above.

seisman commented 8 months ago

The issue has been addressed in PR #3073 and #3076. Closing.