Skip to content

Commit 41beb23

Browse files
authored
Merge branch 'main' into fix-inset
2 parents 4292292 + 37ab418 commit 41beb23

File tree

9 files changed

+118
-86
lines changed

9 files changed

+118
-86
lines changed

README.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ Simple installation using `conda <https://docs.conda.io/projects/conda/en/latest
8686

8787
conda install --channel conda-forge pygmt
8888

89+
If you use `mamba <https://mamba.readthedocs.org/>`__::
90+
91+
mamba install --channel conda-forge pygmt
92+
8993
For other ways to install ``pygmt``, see `full installation instructions <https://www.pygmt.org/latest/install.html>`__.
9094

9195

doc/install.rst

Lines changed: 99 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,43 @@ Quickstart
88

99
The fastest way to install PyGMT is with the
1010
`conda <https://docs.conda.io/projects/conda/en/latest/user-guide/index.html>`__
11+
or `mamba <https://mamba.readthedocs.io/en/latest/>`__
1112
package manager which takes care of setting up a virtual environment, as well
12-
as the installation of GMT and all the dependencies PyGMT depends on::
13+
as the installation of GMT and all the dependencies PyGMT depends on:
1314

14-
conda create --name pygmt --channel conda-forge pygmt
15+
.. tab-set::
1516

16-
To activate the virtual environment, you can do::
17+
.. tab-item:: conda
18+
:sync: conda
1719

18-
conda activate pygmt
20+
::
21+
22+
conda create --name pygmt --channel conda-forge pygmt
23+
24+
.. tab-item:: mamba
25+
:sync: mamba
26+
27+
::
28+
29+
mamba create --name pygmt --channel conda-forge pygmt
30+
31+
To activate the virtual environment, you can do:
32+
33+
.. tab-set::
34+
35+
.. tab-item:: conda
36+
:sync: conda
37+
38+
::
39+
40+
conda activate pygmt
41+
42+
.. tab-item:: mamba
43+
:sync: mamba
44+
45+
::
46+
47+
mamba activate pygmt
1948

2049
After this, check that everything works by running the following in a Python
2150
interpreter (e.g., in a Jupyter notebook)::
@@ -96,13 +125,41 @@ First, we must configure conda to get packages from the
96125

97126
Now we can create a new conda environment with Python and all our dependencies
98127
installed (we'll call it ``pygmt`` but feel free to change it to whatever you
99-
want)::
128+
want):
129+
130+
.. tab-set::
131+
132+
.. tab-item:: conda
133+
:sync: conda
134+
135+
::
136+
137+
conda create --name pygmt python=3.9 numpy pandas xarray netcdf4 packaging gmt
138+
139+
.. tab-item:: mamba
140+
:sync: mamba
141+
142+
::
100143

101-
conda create --name pygmt python=3.9 numpy pandas xarray netcdf4 packaging gmt
144+
mamba create --name pygmt python=3.9 numpy pandas xarray netcdf4 packaging gmt
102145

103-
Activate the environment by running the following (**do not forget this step!**)::
146+
Activate the environment by running the following (**do not forget this step!**):
104147

105-
conda activate pygmt
148+
.. tab-set::
149+
150+
.. tab-item:: conda
151+
:sync: conda
152+
153+
::
154+
155+
conda activate pygmt
156+
157+
.. tab-item:: mamba
158+
:sync: mamba
159+
160+
::
161+
162+
mamba activate pygmt
106163

107164
From now on, all commands will take place inside the conda virtual environment
108165
called ``pygmt`` and won't affect your default ``base`` installation.
@@ -114,17 +171,45 @@ Installing PyGMT
114171
Now that you have GMT installed and your conda virtual environment activated,
115172
you can install PyGMT using any of the following methods:
116173

117-
Using conda (recommended)
118-
~~~~~~~~~~~~~~~~~~~~~~~~~
174+
Using conda/mamba (recommended)
175+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
119176

120177
This installs the latest stable release of PyGMT from
121-
`conda-forge <https://anaconda.org/conda-forge/pygmt>`__::
178+
`conda-forge <https://anaconda.org/conda-forge/pygmt>`__:
179+
180+
.. tab-set::
181+
182+
.. tab-item:: conda
183+
:sync: conda
184+
185+
::
186+
187+
conda install pygmt
188+
189+
.. tab-item:: mamba
190+
:sync: mamba
191+
192+
::
193+
194+
mamba install pygmt
195+
196+
This upgrades the installed PyGMT version to be the latest stable release:
197+
198+
.. tab-set::
199+
200+
.. tab-item:: conda
201+
:sync: conda
202+
203+
::
204+
205+
conda update pygmt
122206

123-
conda install pygmt
207+
.. tab-item:: mamba
208+
:sync: mamba
124209

125-
This upgrades the installed PyGMT version to be the latest stable release::
210+
::
126211

127-
conda update pygmt
212+
mamba update pygmt
128213

129214
Using pip
130215
~~~~~~~~~

pygmt/src/histogram.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,10 @@
22
Histogram - Create a histogram
33
"""
44
from pygmt.clib import Session
5-
from pygmt.helpers import (
6-
build_arg_string,
7-
deprecate_parameter,
8-
fmt_docstring,
9-
kwargs_to_strings,
10-
use_alias,
11-
)
5+
from pygmt.helpers import build_arg_string, fmt_docstring, kwargs_to_strings, use_alias
126

137

148
@fmt_docstring
15-
@deprecate_parameter("table", "data", "v0.5.0", remove_version="v0.7.0")
169
@use_alias(
1710
A="horizontal",
1811
B="frame",

pygmt/src/info.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@
66
from pygmt.helpers import (
77
GMTTempFile,
88
build_arg_string,
9-
deprecate_parameter,
109
fmt_docstring,
1110
kwargs_to_strings,
1211
use_alias,
1312
)
1413

1514

1615
@fmt_docstring
17-
@deprecate_parameter("table", "data", "v0.5.0", remove_version="v0.7.0")
1816
@use_alias(
1917
C="per_column",
2018
I="spacing",

pygmt/src/surface.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
GMTTempFile,
88
build_arg_string,
99
check_data_input_order,
10-
deprecate_parameter,
1110
fmt_docstring,
1211
kwargs_to_strings,
1312
use_alias,
@@ -18,7 +17,6 @@
1817

1918

2019
@fmt_docstring
21-
@deprecate_parameter("outfile", "outgrid", "v0.5.0", remove_version="v0.7.0")
2220
@check_data_input_order("v0.5.0", remove_version="v0.7.0")
2321
@use_alias(
2422
I="spacing",

pygmt/src/wiggle.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@
55
from pygmt.helpers import (
66
build_arg_string,
77
check_data_input_order,
8-
deprecate_parameter,
98
fmt_docstring,
109
kwargs_to_strings,
1110
use_alias,
1211
)
1312

1413

1514
@fmt_docstring
16-
@deprecate_parameter("columns", "incols", "v0.5.0", remove_version="v0.7.0")
1715
@check_data_input_order("v0.5.0", remove_version="v0.7.0")
1816
@use_alias(
1917
B="frame",

pygmt/tests/test_info.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,6 @@ def test_info():
3131
assert output == expected_output
3232

3333

34-
def test_info_deprecate_table_to_data():
35-
"""
36-
Make sure that the old parameter "table" is supported and it reports a
37-
warning.
38-
"""
39-
with pytest.warns(expected_warning=FutureWarning) as record:
40-
output = info(table=POINTS_DATA) # pylint: disable=no-value-for-parameter
41-
expected_output = (
42-
f"{POINTS_DATA}: N = 20 "
43-
"<11.5309/61.7074> "
44-
"<-2.9289/7.8648> "
45-
"<0.1412/0.9338>\n"
46-
)
47-
assert output == expected_output
48-
assert len(record) == 1 # check that only one warning was raised
49-
50-
5134
@pytest.mark.parametrize(
5235
"table",
5336
[

pygmt/tests/test_surface.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -145,25 +145,3 @@ def test_surface_with_outgrid_param(data, region, spacing, expected_grid):
145145
assert os.path.exists(path=tmpfile.name) # check that outgrid exists at path
146146
with xr.open_dataarray(tmpfile.name) as grid:
147147
check_values(grid, expected_grid)
148-
149-
150-
def test_surface_deprecate_outfile_to_outgrid(data, region, spacing, expected_grid):
151-
"""
152-
Make sure that the old parameter "outfile" is supported and it reports a
153-
warning.
154-
"""
155-
with pytest.warns(expected_warning=FutureWarning) as record:
156-
data = data.values # convert pandas.DataFrame to numpy.ndarray
157-
with GMTTempFile(suffix=".nc") as tmpfile:
158-
output = surface(
159-
data=data,
160-
spacing=spacing,
161-
region=region,
162-
outfile=tmpfile.name,
163-
verbose="e", # Suppress warnings for IEEE 754 rounding
164-
)
165-
assert output is None # check that output is None since outfile is set
166-
assert os.path.exists(path=tmpfile.name) # check that file exists at path
167-
with xr.open_dataarray(tmpfile.name) as grid:
168-
check_values(grid, expected_grid)
169-
assert len(record) == 1 # check that only one warning was raised

pygmt/tests/test_wiggle.py

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,33 +32,28 @@ def test_wiggle():
3232

3333

3434
@pytest.mark.mpl_image_compare(filename="test_wiggle.png")
35-
def test_wiggle_deprecate_columns_to_incols():
35+
def test_wiggle_data_incols():
3636
"""
37-
Make sure that the old parameter "columns" is supported and it reports a
38-
warning.
39-
40-
Modified from the test_wiggle() test.
37+
Make sure that incols parameter works with input data array.
4138
"""
4239

4340
# put data into numpy array and swap x and y columns
44-
# as the use of the 'columns' parameter will reverse this action
41+
# as the use of the 'incols' parameter will reverse this action
4542
x = np.arange(-2, 2, 0.02)
4643
y = np.zeros(x.size)
4744
z = np.cos(2 * np.pi * x)
4845
data = np.array([y, x, z]).T
4946

5047
fig = Figure()
51-
with pytest.warns(expected_warning=FutureWarning) as record:
52-
fig.wiggle(
53-
data,
54-
region=[-4, 4, -1, 1],
55-
projection="X8c",
56-
columns=[1, 0, 2],
57-
scale="0.5c",
58-
color=["red+p", "gray+n"],
59-
pen="1.0p",
60-
track="0.5p",
61-
position="jRM+w2+lnT",
62-
)
63-
assert len(record) == 1 # check that only one warning was raised
48+
fig.wiggle(
49+
data,
50+
region=[-4, 4, -1, 1],
51+
projection="X8c",
52+
incols=[1, 0, 2],
53+
scale="0.5c",
54+
color=["red+p", "gray+n"],
55+
pen="1.0p",
56+
track="0.5p",
57+
position="jRM+w2+lnT",
58+
)
6459
return fig

0 commit comments

Comments
 (0)