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

Figure.velo: Deprecate parameters "color" to "fill" and "uncertaintycolor" to "uncertaintyfill" (remove in v0.12.0) #2206

Merged
merged 5 commits into from
Nov 25, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions pygmt/src/velo.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,24 @@
import pandas as pd
from pygmt.clib import Session
from pygmt.exceptions import GMTInvalidInput
from pygmt.helpers import build_arg_string, fmt_docstring, kwargs_to_strings, use_alias
from pygmt.helpers import (
build_arg_string,
deprecate_parameter,
fmt_docstring,
kwargs_to_strings,
use_alias,
)


@fmt_docstring
@deprecate_parameter("color", "fill", "v0.8.0", "v0.12.0")
@use_alias(
A="vector",
B="frame",
C="cmap",
D="rescale",
E="uncertaintycolor",
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering if we should also deprecated uncertaintycolor to uncertaintyfill.

Copy link
Member Author

@michaelgrund michaelgrund Nov 24, 2022

Choose a reason for hiding this comment

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

In my opinion, yes since it also colors the inside of a polygon! I made some changes. If we go with uncertaintyfill then test_velo.py also needs to be updated.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, please also update test_velo.py then we can ping other maintainers to see what they think about the two deprecations.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done @seisman.

G="color",
G="fill",
H="scale",
I="shading",
J="projection",
Expand Down Expand Up @@ -78,7 +85,7 @@ def velo(self, data=None, **kwargs):
[Default is 9p,Helvetica,black]; give **+f**\ 0 to deactivate
labeling. The arrow will be drawn with the pen attributes specified
by the ``pen`` parameter and the arrow-head can be colored via
``color``. The ellipse will be filled with the color or shade
``fill``. The ellipse will be filled with the color or shade
specified by the ``uncertaintycolor`` parameter [Default is
transparent], and its outline will be drawn if ``line`` is selected
using the pen selected (by ``pen`` if not given by ``line``).
Expand Down Expand Up @@ -111,7 +118,7 @@ def velo(self, data=None, **kwargs):
[Default is 9p,Helvetica,black]; give **+f**\ 0 to deactivate
labeling. The arrow will be drawn with the pen attributes specified
by the ``pen`` parameter and the arrow-head can be colored via
``color``. The ellipse will be filled with the color or shade
``fill``. The ellipse will be filled with the color or shade
specified by the ``uncertaintycolor`` parameter [Default is
transparent], and its outline will be drawn if ``line`` is selected
using the pen selected (by ``pen`` if not given by ``line``).
Expand All @@ -130,7 +137,7 @@ def velo(self, data=None, **kwargs):
*wedgescale* is not given then we read it from the data file as an
extra column. Rotation values are multiplied by *wedgemag* before
plotting. For example, setting *wedgemag* to 1.e7 works well for
rotations of the order of 100 nanoradians/yr. Use ``color`` to set
rotations of the order of 100 nanoradians/yr. Use ``fill`` to set
the fill color or shade for the wedge, and ``uncertaintycolor`` to
set the color or shade for the uncertainty. Parameters are expected
to be in the following columns:
Expand Down Expand Up @@ -173,7 +180,7 @@ def velo(self, data=None, **kwargs):
``zvalue="+e"`` will update the uncertainty fill color based on the
selected measure in ``zvalue`` [magnitude error]. More details at
:gmt-docs:`cookbook/features.html#gfill-attrib`.
color : str
fill : str
Select color or pattern for filling of symbols [Default is no fill].
**Note**: Using ``cmap`` (and optionally ``zvalue``) will update the
symbol fill color based on the selected measure in ``zvalue``
Expand Down