From 1a5551699d0914c202c074618b4bf33bae902ea8 Mon Sep 17 00:00:00 2001 From: Wei Ji Date: Mon, 21 Sep 2020 10:53:19 +1200 Subject: [PATCH 1/2] Add common alias cores (x) to decorators.py --- pygmt/helpers/decorators.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pygmt/helpers/decorators.py b/pygmt/helpers/decorators.py index 1618d12eea5..583e407b2e4 100644 --- a/pygmt/helpers/decorators.py +++ b/pygmt/helpers/decorators.py @@ -89,6 +89,16 @@ Only visible when PDF or raster format output is selected. Only the PNG format selection adds a transparency layer in the image (for further processing). """, + "x": """\ + cores : int + ``[[-]n]``. + Limit the number of cores to be used in any OpenMP-enabled + multi-threaded algorithms. By default we try to use all available + cores. Set a number *n* to only use n cores (if too large it will + be truncated to the maximum cores available). Finally, give a + negative number *-n* to select (all - n) cores (or at least 1 if + n equals or exceeds all). + """, } From 391649bcf671d819712ced9f389cb0c78e831a4d Mon Sep 17 00:00:00 2001 From: Wei Ji Date: Mon, 21 Sep 2020 10:57:03 +1200 Subject: [PATCH 2/2] Alias cores (x) in grdimage --- pygmt/base_plotting.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pygmt/base_plotting.py b/pygmt/base_plotting.py index 950e1b089de..56c3b8c769b 100644 --- a/pygmt/base_plotting.py +++ b/pygmt/base_plotting.py @@ -310,6 +310,7 @@ def grdcontour(self, grid, **kwargs): I="shading", C="cmap", t="transparency", + x="cores", ) @kwargs_to_strings(R="sequence") def grdimage(self, grid, **kwargs): @@ -327,6 +328,7 @@ def grdimage(self, grid, **kwargs): grid : str or xarray.DataArray The file name of the input grid or the grid loaded as a DataArray. {t} + {x} """ kwargs = self._preprocess(**kwargs)