You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
In some functions, G is aliased as "fill" but shown "color" in docstrings #1617
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
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?
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.
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.
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
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.
Activity
weiji14 commentedon Nov 9, 2021
Right, so the code aliases
-Gasfill:pygmt/pygmt/src/histogram.py
Line 23 in 2ebe165
But we used
{G}in the docstring here:pygmt/pygmt/src/histogram.py
Line 69 in 2ebe165
which means it shows up in the docs as
color:pygmt/pygmt/helpers/decorators.py
Lines 46 to 47 in 2ebe165
So, do we go with using
colororfill?maxrjones commentedon Nov 9, 2021
xref GenericMappingTools/gmt#5563 - I think we're leaning towards fill for GMT, but PyGMT already has color in plot and plot3d.
weiji14 commentedon Nov 9, 2021
Yeah, I think it would be nice to use
filltoo to standardize with GMT. Just that thecolor="G"alias for plot/psxy has been here for 4 years already sincepygmt/gmt/ps_modules.py
Line 10 in aad12e0
willschlitzer commentedon Dec 4, 2021
I think
fillworks better, but it should be changed across the PyGMT modules.seisman commentedon Jan 5, 2022
I also agree that
fillis better.I think it's possible to extend the
use_aliasdecorator to support multiple aliases.For example,
@use_alias(G=["fill", "color"])means bothfillarecolorare accepted.maxrjones commentedon Jan 19, 2022
I prefer that we don't indefinitely support multiple aliases. The
deprecate_parameterdecorator 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 theCOMMON_OPTIONSdict inpygmt/helpers/decorators.pyfromcolortofilland add thedeprecate_parameterdecorator 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.[-]Suggested improvement for api/generated/pygmt.Figure.histogram[/-][+]In some functions, G is aliased as "fill" but shown "color" in docstrings[/+]seisman commentedon Sep 25, 2022
I believe the documentation issue has been fixed by #2124.
Now the question is, do we want to deprecate
colorinplotandplot3d, as suggested in #1617 (comment)willschlitzer commentedon Sep 26, 2022
If the documentation says
fill, I assume we should deprecatecolor? I agree with @maxrjones that we shouldn't indefinitely support multiple aliases.weiji14 commentedon Sep 26, 2022
The documentation for
fig.histogramandfig.ternaryuses thefillalias for-G, butfig.plotandfig.plot3dusescoloras the alias, so there's inconsistency. I say we deprecatecoloras Max recommended above, and do so over 4 minor release cycles, sinceplot/plot3dare widely used.seisman commentedon Oct 30, 2022
I'll work on this issue in a series of PRs:
colortofillinplot.py(Figure.plot: Deprecate parameter "color" to "fill" (remove in v0.12.0) #2177)colortofillinplot3d.py(Figure.plot3d: Deprecate parameter "color" to "fill" (remove in v0.12.0) #2178)colortofillinwiggle.py(Figure.wiggle: Deprecate parameter "color" (remove in v0.12.0) and add "fillpositive"/"fillnegative" #2205)colortofillinvelo.py(Figure.velo: Deprecate parameters "color" to "fill" and "uncertaintycolor" to "uncertaintyfill" (remove in v0.12.0) #2206)colortofillinrose.pyFigure.rose: Deprecate parameter color to fill (remove in v0.12.0) #2181colortofillintest_plot.py(Figure.plot: Update parameter 'color' to 'fill' in test_plot.py #2189)colortofillintest_plot3d.py(Figure.plot3d: Update parameter 'color' to 'fill' in test_plot3d.py #2193)colortofillin examples and tutorials (Update parameter 'color' to 'fill' in examples and tutorials #2201)uncertaintycolortouncertaintyfillin example "Velocity arrows and confidence ellipses" (Update parameter 'uncertaintycolor' to 'uncertaintyfill' in example 'velo_arrow_ellipse.py' #2237)Update parameter 'color' to 'fill' in examples