Skip to content

Figure.rose: Reorder input parameters to 'data, length, azimuth' #1546

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

Merged
merged 9 commits into from
Oct 3, 2021
12 changes: 7 additions & 5 deletions pygmt/src/rose.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from pygmt.clib import Session
from pygmt.helpers import (
build_arg_string,
check_data_input_order,
deprecate_parameter,
fmt_docstring,
kwargs_to_strings,
Expand All @@ -14,6 +15,7 @@

@fmt_docstring
@deprecate_parameter("columns", "incols", "v0.4.0", remove_version="v0.6.0")
@check_data_input_order("v0.5.0", remove_version="v0.7.0")
@use_alias(
A="sector",
B="frame",
Expand Down Expand Up @@ -47,7 +49,7 @@
w="wrap",
)
@kwargs_to_strings(R="sequence", c="sequence_comma", i="sequence_comma", p="sequence")
def rose(self, length=None, azimuth=None, data=None, **kwargs):
def rose(self, data=None, length=None, azimuth=None, **kwargs):
"""
Plot windrose diagrams or polar histograms.

Expand All @@ -67,10 +69,6 @@ def rose(self, length=None, azimuth=None, data=None, **kwargs):

Parameters
----------
length/azimuth : float or 1d arrays
Length and azimuth values, or arrays of length and azimuth
values

data : str or {table-like}
Pass in either a file name to an ASCII data table, a 2D
{table-classes}.
Expand All @@ -79,6 +77,10 @@ def rose(self, length=None, azimuth=None, data=None, **kwargs):
indicate the single column with azimuths; then all lengths are set to
unity (see ``scale = 'u'`` to set actual lengths to unity as well).

length/azimuth : float or 1d arrays
Length and azimuth values, or arrays of length and azimuth
values

orientation : bool
Specifies that the input data are orientation data (i.e., have a
180 degree ambiguity) instead of true 0-360 degree directions
Expand Down
2 changes: 1 addition & 1 deletion pygmt/tests/test_rose.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def test_rose_deprecate_columns_to_incols(data_fractures_compilation):
fig = Figure()
with pytest.warns(expected_warning=FutureWarning) as record:
fig.rose(
data=data,
data,
region=[0, 1, 0, 360],
sector=10,
columns=[1, 0],
Expand Down