From 54577a8b6017101fddfbdbf8b6de0e5fbacdac5f Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Tue, 2 Jan 2024 20:40:35 +1300 Subject: [PATCH 1/4] Add common alias cores (x) for grdlandmask --- pygmt/src/grdlandmask.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pygmt/src/grdlandmask.py b/pygmt/src/grdlandmask.py index f109a821e89..beb06450959 100644 --- a/pygmt/src/grdlandmask.py +++ b/pygmt/src/grdlandmask.py @@ -26,6 +26,7 @@ R="region", V="verbose", r="registration", + x="cores", ) @kwargs_to_strings(I="sequence", R="sequence", N="sequence", E="sequence") def grdlandmask(**kwargs): @@ -82,6 +83,7 @@ def grdlandmask(**kwargs): considered outside [Default is inside]. {verbose} {registration} + {cores} Returns ------- From 137a04fbbd44e5493bf53d9ffe43fa8c9c5b453c Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Tue, 2 Jan 2024 20:47:44 +1300 Subject: [PATCH 2/4] Run test_grdlandmask_no_outgrid with 2 cores --- pygmt/tests/test_grdlandmask.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/tests/test_grdlandmask.py b/pygmt/tests/test_grdlandmask.py index 4d71b5c38ff..5340c4269fe 100644 --- a/pygmt/tests/test_grdlandmask.py +++ b/pygmt/tests/test_grdlandmask.py @@ -49,7 +49,7 @@ def test_grdlandmask_no_outgrid(expected_grid): """ Test grdlandmask with no set outgrid. """ - result = grdlandmask(spacing=1, region=[125, 130, 30, 35]) + result = grdlandmask(spacing=1, region=[125, 130, 30, 35], cores=2) # check information of the output grid assert isinstance(result, xr.DataArray) assert result.gmt.gtype == 1 # Geographic grid From 35e2d615d9ba3d6b4827a6d9693a654e12be5537 Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Thu, 4 Jan 2024 11:24:00 +1300 Subject: [PATCH 3/4] Try setting cores=1 and turn on verbose info mode --- pygmt/tests/test_grdlandmask.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/tests/test_grdlandmask.py b/pygmt/tests/test_grdlandmask.py index 5340c4269fe..a9eb572e860 100644 --- a/pygmt/tests/test_grdlandmask.py +++ b/pygmt/tests/test_grdlandmask.py @@ -49,7 +49,7 @@ def test_grdlandmask_no_outgrid(expected_grid): """ Test grdlandmask with no set outgrid. """ - result = grdlandmask(spacing=1, region=[125, 130, 30, 35], cores=2) + result = grdlandmask(spacing=1, region=[125, 130, 30, 35], cores=1, verbose="i") # check information of the output grid assert isinstance(result, xr.DataArray) assert result.gmt.gtype == 1 # Geographic grid From 97637d4dffa252ce3160cec452accfe5fec57fcc Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Thu, 4 Jan 2024 14:25:49 +1300 Subject: [PATCH 4/4] Revert "Try setting cores=1 and turn on verbose info mode" This reverts commit 35e2d615d9ba3d6b4827a6d9693a654e12be5537. --- pygmt/tests/test_grdlandmask.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/tests/test_grdlandmask.py b/pygmt/tests/test_grdlandmask.py index a9eb572e860..5340c4269fe 100644 --- a/pygmt/tests/test_grdlandmask.py +++ b/pygmt/tests/test_grdlandmask.py @@ -49,7 +49,7 @@ def test_grdlandmask_no_outgrid(expected_grid): """ Test grdlandmask with no set outgrid. """ - result = grdlandmask(spacing=1, region=[125, 130, 30, 35], cores=1, verbose="i") + result = grdlandmask(spacing=1, region=[125, 130, 30, 35], cores=2) # check information of the output grid assert isinstance(result, xr.DataArray) assert result.gmt.gtype == 1 # Geographic grid