From aad12e0879bc71a7dbb396298ed87d68c7d53c80 Mon Sep 17 00:00:00 2001 From: Leonardo Uieda Date: Fri, 7 Jul 2017 22:14:57 -1000 Subject: [PATCH] Decorator to setup aliases for commands --- gmt/ps_modules.py | 7 +- gmt/tests/baseline/test_psbasemap_aliases.png | Bin 0 -> 17626 bytes gmt/tests/baseline/test_psxy_aliases.png | Bin 0 -> 40714 bytes gmt/tests/test_psbasemap.py | 12 ++- gmt/tests/test_psxy.py | 8 ++ gmt/utils.py | 70 ++++++++++++++---- 6 files changed, 81 insertions(+), 16 deletions(-) create mode 100644 gmt/tests/baseline/test_psbasemap_aliases.png create mode 100644 gmt/tests/baseline/test_psxy_aliases.png diff --git a/gmt/ps_modules.py b/gmt/ps_modules.py index f1e8fd13ee7..eee45d00215 100644 --- a/gmt/ps_modules.py +++ b/gmt/ps_modules.py @@ -2,9 +2,12 @@ Function wrapper for the ps* modules. """ from .clib import call_module -from .utils import fmt_docstring, parse_bools, parse_region, kwargs2string +from .utils import fmt_docstring, parse_bools, parse_region, kwargs2string, \ + use_alias +@use_alias(R='region', J='projection', B='frame', P='portrait', S='style', + G='color') @fmt_docstring @parse_bools @parse_region @@ -54,12 +57,14 @@ def psxy(data, **kwargs): W : str Set pen attributes for lines or the outline of symbols. + """ assert isinstance(data, str), 'Only accepts file names for now.' arg_str = ' '.join([data, kwargs2string(kwargs)]) call_module('psxy', arg_str) +@use_alias(R='region', J='projection', B='frame', P='portrait') @fmt_docstring @parse_bools @parse_region diff --git a/gmt/tests/baseline/test_psbasemap_aliases.png b/gmt/tests/baseline/test_psbasemap_aliases.png new file mode 100644 index 0000000000000000000000000000000000000000..b12272ec081194ffeb67cb4b671fc5dab1cf128c GIT binary patch literal 17626 zcmZvE30RC>^!S}NQ&Ll=B*jdnMp{N`6Pc!Iv6QAl_Mug_HVM%yr4cGbMVKZs;UoJN zCW$tL2$4kDvK2~}e&@dL^!>i)|NFns^F3d8?z!il{hoX7y*B&%c@NSs)IbOgn&cx0 z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!Miy~m=OKeS@5Im-2+V!WJokd?m#XmP(61dIyPCXBvP`ehRH@=d`uHT5{m3g61Shb z=m$QlcJBbHg1JSLF*@#$nPbpvppNU*7>gHb$B8toHTgJr=89NKjpisCu$QuCLUiLL z9~Yn&DD}&0-p?Pf+(s3iWWJaikK}7%hFKTf!2hCR*3nQJ(0)Irk`7vH2~a{>KyB60 z-mus0lOeT)kVlgbg#kpQ!V2+AVpTYC+>he$Y?sz$7a zZtjlJQFE^Nfw8Jg!T&A*&b$JKB3!oQ(LdUpcAEJV9<%U)w(p>MMkcVv)7^a)mEzMe zeq5Lqk}tA~p|QZmQG5Nj*mZH0T8KAg#%a(X&=MFs3}`Ed2gq_b6aou;sf-xzA6C8# zU#x)!gK3IJVdf`b04!{)T7S^4{R6D+sUT&wx6R!45P8`8^`WjLVwoI9MOCEI*h)U;>^P{Jx*H;VQ~Va}iwZ zdyNlqb@J~(Vcg(U>62s25McmpvBsSq1`3*Ci;xqH;f|;P z>b4Gb>Sj^>v@@gj9%7+=p00Y$&K61t=i6v2GkSQ$Iyz5}b~k3`op>+$U8fl=V@o1EHb# z*QHHoJnBX-nJrqKc^`}(q77;}RPtv3%-xseR{GAbmuFsr_tbcz$IG@Yeits%_;$9g zJT4B5Rf3Nocn+g)2PdBjS96O+Du_4?q@y*#D+Oyq<_%gh=NGG;u7-H9JR`L6p9#%> zs-F&96bmH?A^`)o*4P`b4=vP+a9#re2|xBmr)$PXt`A*!_xkUXFTTQi8k|o9lc7uJ zT|bM8dItWfI$!}DVuGqFRm#RSGAH#kmDG-a-Pa_{PxM{+1f^WdH$Tm^Un|4zeI`a~ z6k4P0axqg4;Y9}?Ih)NWpF7tSUf9pW&8>%Lx(6Olf(P{E1+LR literal 0 HcmV?d00001 diff --git a/gmt/tests/baseline/test_psxy_aliases.png b/gmt/tests/baseline/test_psxy_aliases.png new file mode 100644 index 0000000000000000000000000000000000000000..c835ce8b991792b87b224cbbbcabc6f77cdeb820 GIT binary patch literal 40714 zcme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2^(^jbyOc=B35&UENe334 z@|NEMFGJtjoRnDE91BapeJ*;ebg$Yy=X|)Qp_cjB8Ge37et}kPJ?o|ga>aTdI1gns zCoF8uI}1Nl2782B9i!n_*5UKPp$rx;Z|}LHWqxDVDnv@x?p_1SX5BZ73*J$ip%MEJ z3ayEksIo1?8OBY$Aho7YDwC)$4Sk_Gtp{U+adyFQ}kJ&^ZWe9}&l8VdI+knY6Iq$IOr zS(&SgPox8zb-YrlbWJ2~elg+}^o!qjNdskdeAvur1lLr z7tDV=siGZVUm|zzLPz5<<`|3fJ|^tJxgZI^9T%kM!yGpUYb)PX_ZHs?wwDn!a?Uyb zO3`m+gL!y;`GYc_aJ!t9%V7j8j#ayU++;p>Zk}f>aXqT_snW~%Mpp;!Gs!eT-x|+Q zEpTwWK@;eB1ykC)hp%f|Wc+xQA%@>hSagRIFK}_|J7mvy$T@Fq(=sMT^J1H)23xyz zb(FobKqzBY^lb&>r~L2crOtBa;jYLl^Rb84Z-%^)hY7k)?WvE6ea^}yfQ-`NYS&HX zHHRZF0PujrlClT5m0NjXmi)^Mrm(^!7{rrrUUw>=+^6&>pjUHIz8LFkH1sjK9n3-@~lzPRL^ zH@KQ*?W+N^nRa&}~WIbWGi)$N((A?kKeryHgj z^O38=SP%%S_+asg+0_Uhsf$>0>~eHTde%y=%xJ*~ymURhZC!J!&3{+EA|uwEq0@iy zt(<&ODa)|TXXcKa^R;((i(U8z9M%YzmwD*wFck}&@mS!DpsjPRzW$>BunG%Z?G1YC JQ`g!Y{6F@Ln4|yz literal 0 HcmV?d00001 diff --git a/gmt/tests/test_psbasemap.py b/gmt/tests/test_psbasemap.py index c20cd437349..1e588a4e14d 100644 --- a/gmt/tests/test_psbasemap.py +++ b/gmt/tests/test_psbasemap.py @@ -18,7 +18,7 @@ def test_basemap_required_args(): def test_basemap_d(): "Make sure the D option works" figure() - psbasemap(region='10/70/-300/800', J='X3i/5i', B='af', + psbasemap(R='10/70/-300/800', J='X3i/5i', B='af', D='30/35/-200/500', F=True) @@ -40,7 +40,7 @@ def test_psbasemap(): def test_psbasemap_list_region(): "Create a simple basemap plot passing the region as a list" figure() - psbasemap(region=[-20, 50, 200, 500], J='X3i/3i', B='a') + psbasemap(R=[-20, 50, 200, 500], J='X3i/3i', B='a') @figure_comparison_test @@ -71,3 +71,11 @@ def test_psbasemap_winkel_tripel(): "Create a Winkel Tripel basemap plot" figure() psbasemap(R='90/450/-90/90', J='R270/25c', B='afg') + + +@figure_comparison_test +def test_psbasemap_aliases(): + "Make sure the argument aliases work" + figure() + psbasemap(region=[0, 360, -90, 90], projection='W7i', frame=True, + portrait=True) diff --git a/gmt/tests/test_psxy.py b/gmt/tests/test_psxy.py index dba93574477..0e96885a6cb 100644 --- a/gmt/tests/test_psxy.py +++ b/gmt/tests/test_psxy.py @@ -23,3 +23,11 @@ def test_psxy_projection(): "Plot the data in green squares with a projection" figure() psxy(POINTS_DATA, R='g', J='R270/4i', S='s0.2c', G='green', B='ag') + + +@figure_comparison_test +def test_psxy_aliases(): + "Use aliases for the arguments and make sure they work" + figure() + psxy(POINTS_DATA, region=[10, 70, -3, 8], projection='X10i', + style='d0.5c', color='yellow', frame=True, portrait=True) diff --git a/gmt/utils.py b/gmt/utils.py index 0a9cd5893e0..b9fe4bbff39 100644 --- a/gmt/utils.py +++ b/gmt/utils.py @@ -9,12 +9,12 @@ COMMON_OPTIONS = { 'R': '''\ - R or region : str or list + R : str or list *Required if this is the first plot command*. ``'xmin/xmax/ymin/ymax[+r][+uunit]'``. Specify the region of interest.''', 'J': '''\ - J or projection : str + J : str *Required if this is the first plot command*. Select map projection.''', 'B': '''\ @@ -31,9 +31,9 @@ File name of a CPT file or ``C='color1,color2[,color3,...]'`` to build a linear continuous CPT from those colors automatically.''', 'G': '''\ - G : str - Select color or pattern for filling of symbols or polygons. Default is - no fill.''', + G : str + Select color or pattern for filling of symbols or polygons. Default + is no fill.''', } @@ -82,11 +82,11 @@ def fmt_docstring(module_func): Parameters ---------- - R or region : str or list + R : str or list *Required if this is the first plot command*. ``'xmin/xmax/ymin/ymax[+r][+uunit]'``. Specify the region of interest. - J or projection : str + J : str *Required if this is the first plot command*. Select map projection. @@ -142,6 +142,56 @@ def kwargs2string(kwargs): return arg_str +def use_alias(**aliases): + """ + Decorator to add aliases to keyword arguments of a function. + + Replaces the aliases with their desired names before passing them along to + the module function. + + Keywords passed to this decorator are the desired argument name and their + value is the alias. + + Use this as the last decorator applied to a function (the furthest from the + ``def`` statement). + + Examples + -------- + + >>> @use_alias(R='region', J='projection') + ... def my_module(**kwargs): + ... print('R =', kwargs['R'], 'J =', kwargs['J']) + >>> my_module(R='bla', J='meh') + R = bla J = meh + >>> my_module(region='bla', J='meh') + R = bla J = meh + >>> my_module(R='bla', projection='meh') + R = bla J = meh + >>> my_module(region='bla', projection='meh') + R = bla J = meh + + """ + + def alias_decorator(module_func): + """ + Decorator that replaces the aliases for arguments. + """ + + @functools.wraps(module_func) + def new_module(*args, **kwargs): + """ + New module that parses and replaces the registered aliases. + """ + for arg, alias in aliases.items(): + if alias in kwargs: + kwargs[arg] = kwargs.pop(alias) + return module_func(*args, **kwargs) + + return new_module + + return alias_decorator + + def parse_bools(module_func): """ Parse boolean arguments and transform them into option strings. @@ -228,10 +278,6 @@ def parse_region(module_func): {'R': '1/2/3/4'} >>> my_module(R=[1, 2, 3, 4]) {'R': '1/2/3/4'} - >>> my_module(region=[1, 2, 3, 4]) - {'R': '1/2/3/4'} - >>> my_module(region='1/2/3/4') - {'R': '1/2/3/4'} """ @@ -240,8 +286,6 @@ def new_module(*args, **kwargs): """ New function that parses R before executing the module. """ - if 'region' in kwargs: - kwargs['R'] = kwargs.pop('region') if 'R' in kwargs: value = kwargs['R'] if is_nonstr_iter(value):