Skip to content

In some functions, G is aliased as "fill" but shown "color" in docstrings #1617

Closed

Description

@mdtanker

Noticed a mistake here: -G (fill) is listed as "color" under the "Parameters" section, should be "fill".

Activity

  1. added
    documentation
    on Nov 9, 2021
  2. weiji14 commented on Nov 9, 2021

    @weiji14
    Member

    Right, so the code aliases -G as fill:

    G="fill",

    But we used {G} in the docstring here:

    which means it shows up in the docs as color:

    "G": """\
    color : str or 1d array

    image

    So, do we go with using color or fill?

  3. maxrjones commented on Nov 9, 2021

    @maxrjones
    Member

    xref GenericMappingTools/gmt#5563 - I think we're leaning towards fill for GMT, but PyGMT already has color in plot and plot3d.

  4. weiji14 commented on Nov 9, 2021

    @weiji14
    Member

    xref GenericMappingTools/gmt#5563 - I think we're leaning towards fill for GMT, but PyGMT already has color in plot and plot3d.

    Yeah, I think it would be nice to use fill too to standardize with GMT. Just that the color="G" alias for plot/psxy has been here for 4 years already since

    G='color')
    so this would be a pretty significant deprecation. Ok with deprecating this though, because 'color' is a pretty generic term, and 'fill' is more specific to mean just the inside of the symbol/polygon being plotted. What do others think?

  5. willschlitzer commented on Dec 4, 2021

    @willschlitzer
    Contributor

    I think fill works better, but it should be changed across the PyGMT modules.

  6. added this to the 0.6.0 milestone on Jan 5, 2022
  7. seisman commented on Jan 5, 2022

    @seisman
    Member

    I also agree that fill is better.

    I think it's possible to extend the use_alias decorator to support multiple aliases.
    For example, @use_alias(G=["fill", "color"]) means both fill are color are accepted.

  8. maxrjones commented on Jan 19, 2022

    @maxrjones
    Member

    I prefer that we don't indefinitely support multiple aliases. The deprecate_parameter decorator is already designed to allow two parameter names, only temporarily with a warning. My preferred path forward would be to update the parameter name of "G" in the COMMON_OPTIONS dict in pygmt/helpers/decorators.py from color to fill and add the deprecate_parameter decorator to plot and plot3d with a long deprecation time-frame (e.g., 4 release cycles). This path forward would not require any changes to #1431.

  9. modified the milestones: 0.6.0, 0.7.0 on Mar 11, 2022
  10. changed the title [-]Suggested improvement for api/generated/pygmt.Figure.histogram[/-] [+]In some functions, G is aliased as "fill" but shown "color" in docstrings[/+] on May 6, 2022
  11. modified the milestones: 0.7.0, 0.8.0 on Jun 23, 2022
  12. seisman commented on Sep 25, 2022

    @seisman
    Member

    I believe the documentation issue has been fixed by #2124.

    Now the question is, do we want to deprecate color in plot and plot3d, as suggested in #1617 (comment)

  13. willschlitzer commented on Sep 26, 2022

    @willschlitzer
    Contributor

    I believe the documentation issue has been fixed by #2124.

    Now the question is, do we want to deprecate color in plot and plot3d, as suggested in #1617 (comment)

    If the documentation says fill, I assume we should deprecate color? I agree with @maxrjones that we shouldn't indefinitely support multiple aliases.

  14. weiji14 commented on Sep 26, 2022

    @weiji14
    Member

    I believe the documentation issue has been fixed by #2124.
    Now the question is, do we want to deprecate color in plot and plot3d, as suggested in #1617 (comment)

    If the documentation says fill, I assume we should deprecate color? I agree with @maxrjones that we shouldn't indefinitely support multiple aliases.

    The documentation for fig.histogram and fig.ternary uses the fill alias for -G, but fig.plot and fig.plot3d uses color as the alias, so there's inconsistency. I say we deprecate color as Max recommended above, and do so over 4 minor release cycles, since plot/plot3d are widely used.

  15. seisman commented on Oct 30, 2022

    @seisman
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentation

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions