From 07ed2385c699193fd90cd9a39dfe778af70f862e Mon Sep 17 00:00:00 2001 From: Michael Grund <23025878+michaelgrund@users.noreply.github.com> Date: Sun, 26 Sep 2021 11:01:36 +0200 Subject: [PATCH 1/3] Figure.rose(): Reorder parameters length, azimuth, data to data, length, azimuth --- pygmt/src/rose.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pygmt/src/rose.py b/pygmt/src/rose.py index e789b2cd702..b43bcb682fc 100644 --- a/pygmt/src/rose.py +++ b/pygmt/src/rose.py @@ -47,7 +47,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. @@ -67,10 +67,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}. @@ -79,6 +75,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 From ee8cacaa15854056a4a41c188b98acdcbde2216f Mon Sep 17 00:00:00 2001 From: Michael Grund Date: Mon, 27 Sep 2021 08:47:59 +0200 Subject: [PATCH 2/3] add decorator --- pygmt/src/rose.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pygmt/src/rose.py b/pygmt/src/rose.py index b43bcb682fc..8089a8510a7 100644 --- a/pygmt/src/rose.py +++ b/pygmt/src/rose.py @@ -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, @@ -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", From 1be83e0574ed986593f696c54b187d02eec510fa Mon Sep 17 00:00:00 2001 From: Michael Grund Date: Fri, 1 Oct 2021 19:02:00 +0200 Subject: [PATCH 3/3] update --- pygmt/tests/test_rose.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/tests/test_rose.py b/pygmt/tests/test_rose.py index 4460c5f6473..4804428e7ca 100644 --- a/pygmt/tests/test_rose.py +++ b/pygmt/tests/test_rose.py @@ -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],