Skip to content

Commit 8a97e1a

Browse files
authored
Fix old references from ~gmt to pygmt (#940)
1 parent 9a63274 commit 8a97e1a

File tree

2 files changed

+32
-31
lines changed

2 files changed

+32
-31
lines changed

pygmt/clib/session.py

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def __enter__(self):
171171
"""
172172
Create a GMT API session and check the libgmt version.
173173
174-
Calls :meth:`~gmt.clib.Session.create`.
174+
Calls :meth:`pygmt.clib.Session.create`.
175175
176176
Raises
177177
------
@@ -197,7 +197,7 @@ def __exit__(self, exc_type, exc_value, traceback):
197197
"""
198198
Destroy the currently open GMT API session.
199199
200-
Calls :meth:`~gmt.clib.Session.destroy`.
200+
Calls :meth:`pygmt.clib.Session.destroy`.
201201
"""
202202
self.destroy()
203203

@@ -296,10 +296,10 @@ def create(self, name):
296296
297297
.. warning::
298298
299-
Usage of :class:`~gmt.clib.Session` as a context manager in a
299+
Usage of :class:`pygmt.clib.Session` as a context manager in a
300300
``with`` block is preferred over calling
301-
:meth:`~gmt.clib.Session.create` and
302-
:meth:`~gmt.clib.Session.destroy` manually.
301+
:meth:`pygmt.clib.Session.create` and
302+
:meth:`pygmt.clib.Session.destroy` manually.
303303
304304
Calls ``GMT_Create_Session`` and generates a new ``GMTAPI_CTRL``
305305
struct, which is a :class:`ctypes.c_void_p` pointer. Sets the
@@ -387,10 +387,10 @@ def destroy(self):
387387
388388
.. warning::
389389
390-
Usage of :class:`~gmt.clib.Session` as a context manager in a
390+
Usage of :class:`pygmt.clib.Session` as a context manager in a
391391
``with`` block is preferred over calling
392-
:meth:`~gmt.clib.Session.create` and
393-
:meth:`~gmt.clib.Session.destroy` manually.
392+
:meth:`pygmt.clib.Session.create` and
393+
:meth:`pygmt.clib.Session.destroy` manually.
394394
395395
Calls ``GMT_Destroy_Session`` to terminate and free the memory of a
396396
registered ``GMTAPI_CTRL`` session (the pointer for this struct is
@@ -631,15 +631,16 @@ def _parse_constant(self, constant, valid, valid_modifiers=None):
631631
632632
If valid modifiers are not given, then will assume that modifiers are
633633
not allowed. In this case, will raise a
634-
:class:`~gmt.exceptions.GMTInvalidInput` exception if given a modifier.
634+
:class:`pygmt.exceptions.GMTInvalidInput` exception if given a
635+
modifier.
635636
636637
Parameters
637638
----------
638639
constant : str
639640
The name of a valid GMT API constant, with an optional modifier.
640641
valid : list of str
641642
A list of valid values for the constant. Will raise a
642-
:class:`~gmt.exceptions.GMTInvalidInput` exception if the given
643+
:class:`pygmt.exceptions.GMTInvalidInput` exception if the given
643644
value is not on the list.
644645
"""
645646
parts = constant.split("|")
@@ -739,7 +740,7 @@ def put_vector(self, dataset, column, vector):
739740
Use this function to attach numpy array data to a GMT dataset and pass
740741
it to GMT modules. Wraps ``GMT_Put_Vector``.
741742
742-
The dataset must be created by :meth:`~gmt.clib.Session.create_data`
743+
The dataset must be created by :meth:`pygmt.clib.Session.create_data`
743744
first. Use ``family='GMT_IS_DATASET|GMT_VIA_VECTOR'``.
744745
745746
Not at all numpy dtypes are supported, only: float64, float32, int64,
@@ -755,7 +756,7 @@ def put_vector(self, dataset, column, vector):
755756
----------
756757
dataset : :class:`ctypes.c_void_p`
757758
The ctypes void pointer to a ``GMT_Dataset``. Create it with
758-
:meth:`~gmt.clib.Session.create_data`.
759+
:meth:`pygmt.clib.Session.create_data`.
759760
column : int
760761
The column number of this vector in the dataset (starting from 0).
761762
vector : numpy 1d-array
@@ -802,7 +803,7 @@ def put_strings(self, dataset, family, strings):
802803
Use this function to attach string type numpy array data to a GMT
803804
dataset and pass it to GMT modules. Wraps ``GMT_Put_Strings``.
804805
805-
The dataset must be created by :meth:`~gmt.clib.Session.create_data`
806+
The dataset must be created by :meth:`pygmt.clib.Session.create_data`
806807
first.
807808
808809
.. warning::
@@ -815,7 +816,7 @@ def put_strings(self, dataset, family, strings):
815816
----------
816817
dataset : :class:`ctypes.c_void_p`
817818
The ctypes void pointer to a ``GMT_Dataset``. Create it with
818-
:meth:`~gmt.clib.Session.create_data`.
819+
:meth:`pygmt.clib.Session.create_data`.
819820
family : str
820821
The family type of the dataset. Can be either ``GMT_IS_VECTOR`` or
821822
``GMT_IS_MATRIX``.
@@ -862,7 +863,7 @@ def put_matrix(self, dataset, matrix, pad=0):
862863
Use this function to attach numpy array data to a GMT dataset and pass
863864
it to GMT modules. Wraps ``GMT_Put_Matrix``.
864865
865-
The dataset must be created by :meth:`~gmt.clib.Session.create_data`
866+
The dataset must be created by :meth:`pygmt.clib.Session.create_data`
866867
first. Use ``|GMT_VIA_MATRIX'`` in the family.
867868
868869
Not at all numpy dtypes are supported, only: float64, float32, int64,
@@ -877,7 +878,7 @@ def put_matrix(self, dataset, matrix, pad=0):
877878
----------
878879
dataset : :class:`ctypes.c_void_p`
879880
The ctypes void pointer to a ``GMT_Dataset``. Create it with
880-
:meth:`~gmt.clib.Session.create_data`.
881+
:meth:`pygmt.clib.Session.create_data`.
881882
matrix : numpy 2d-array
882883
The array that will be attached to the dataset. Must be a 2d C
883884
contiguous array.
@@ -910,7 +911,7 @@ def write_data(self, family, geometry, mode, wesn, output, data):
910911
Write a GMT data container to a file.
911912
912913
The data container should be created by
913-
:meth:`~gmt.clib.Session.create_data`.
914+
:meth:`pygmt.clib.Session.create_data`.
914915
915916
Wraps ``GMT_Write_Data`` but only allows writing to a file. So the
916917
``method`` argument is omitted.
@@ -936,7 +937,7 @@ def write_data(self, family, geometry, mode, wesn, output, data):
936937
The output file name.
937938
data : :class:`ctypes.c_void_p`
938939
Pointer to the data container created by
939-
:meth:`~gmt.clib.Session.create_data`.
940+
:meth:`pygmt.clib.Session.create_data`.
940941
941942
Raises
942943
------
@@ -981,7 +982,7 @@ def open_virtual_file(self, family, geometry, direction, data):
981982
982983
GMT uses a virtual file scheme to pass in data to API modules. Use it
983984
to pass in your GMT data structure (created using
984-
:meth:`~gmt.clib.Session.create_data`) to a module that expects an
985+
:meth:`pygmt.clib.Session.create_data`) to a module that expects an
985986
input or output file.
986987
987988
Use in a ``with`` block. Will automatically close the virtual file when
@@ -1096,9 +1097,9 @@ def virtualfile_from_vectors(self, *vectors):
10961097
virtual file upon exit of the ``with`` block.
10971098
10981099
Use this instead of creating the data container and virtual file by
1099-
hand with :meth:`~gmt.clib.Session.create_data`,
1100-
:meth:`~gmt.clib.Session.put_vector`, and
1101-
:meth:`~gmt.clib.Session.open_virtual_file`.
1100+
hand with :meth:`pygmt.clib.Session.create_data`,
1101+
:meth:`pygmt.clib.Session.put_vector`, and
1102+
:meth:`pygmt.clib.Session.open_virtual_file`.
11021103
11031104
If the arrays are C contiguous blocks of memory, they will be passed
11041105
without copying to GMT. If they are not (e.g., they are columns of a 2D
@@ -1206,12 +1207,12 @@ def virtualfile_from_matrix(self, matrix):
12061207
12071208
**Not meant for creating ``GMT_GRID``**. The grid requires more
12081209
metadata than just the data matrix. Use
1209-
:meth:`~gmt.clib.Session.virtualfile_from_grid` instead.
1210+
:meth:`pygmt.clib.Session.virtualfile_from_grid` instead.
12101211
12111212
Use this instead of creating the data container and virtual file by
1212-
hand with :meth:`~gmt.clib.Session.create_data`,
1213-
:meth:`~gmt.clib.Session.put_matrix`, and
1214-
:meth:`~gmt.clib.Session.open_virtual_file`
1213+
hand with :meth:`pygmt.clib.Session.create_data`,
1214+
:meth:`pygmt.clib.Session.put_matrix`, and
1215+
:meth:`pygmt.clib.Session.open_virtual_file`
12151216
12161217
The matrix must be C contiguous in memory. If it is not (e.g., it is a
12171218
slice of a larger array), the array will be copied to make sure it is.
@@ -1288,9 +1289,9 @@ def virtualfile_from_grid(self, grid):
12881289
metadata.
12891290
12901291
Use this instead of creating a data container and virtual file by hand
1291-
with :meth:`~gmt.clib.Session.create_data`,
1292-
:meth:`~gmt.clib.Session.put_matrix`, and
1293-
:meth:`~gmt.clib.Session.open_virtual_file`
1292+
with :meth:`pygmt.clib.Session.create_data`,
1293+
:meth:`pygmt.clib.Session.put_matrix`, and
1294+
:meth:`pygmt.clib.Session.open_virtual_file`
12941295
12951296
The grid data matrix must be C contiguous in memory. If it is not
12961297
(e.g., it is a slice of a larger array), the array will be copied to

pygmt/figure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def savefig(
187187
The KML output generates a companion PNG file.
188188
189189
You can pass in any keyword arguments that
190-
:meth:`~gmt.Figure.psconvert` accepts.
190+
:meth:`pygmt.Figure.psconvert` accepts.
191191
192192
Parameters
193193
----------
@@ -334,7 +334,7 @@ def _preview(self, fmt, dpi, as_bytes=False, **kwargs):
334334
----------
335335
fmt : str
336336
The image format. Can be any extension that
337-
:meth:`~gmt.Figure.savefig` recognizes.
337+
:meth:`pygmt.Figure.savefig` recognizes.
338338
dpi : int
339339
The image resolution (dots per inch).
340340
as_bytes : bool

0 commit comments

Comments
 (0)