@@ -115,6 +115,7 @@ class Session:
115
115
... )
116
116
... # Read the contents of the temp file before it's deleted.
117
117
... print(fout.read().strip())
118
+ ...
118
119
-180 180 -90 90 -8182 5651.5 1 1 360 180 1 1
119
120
"""
120
121
@@ -273,6 +274,7 @@ def get_libgmt_func(self, name, argtypes=None, restype=None):
273
274
... func = lib.get_libgmt_func(
274
275
... "GMT_Destroy_Session", argtypes=[c_void_p], restype=c_int
275
276
... )
277
+ ...
276
278
>>> type(func)
277
279
<class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>
278
280
@@ -707,11 +709,13 @@ def _check_dtype_and_dim(self, array, ndim):
707
709
>>> with Session() as ses:
708
710
... gmttype = ses._check_dtype_and_dim(data, ndim=1)
709
711
... gmttype == ses["GMT_DOUBLE"]
712
+ ...
710
713
True
711
714
>>> data = np.ones((5, 2), dtype="float32")
712
715
>>> with Session() as ses:
713
716
... gmttype = ses._check_dtype_and_dim(data, ndim=2)
714
717
... gmttype == ses["GMT_FLOAT"]
718
+ ...
715
719
True
716
720
717
721
"""
@@ -1041,6 +1045,7 @@ def open_virtual_file(self, family, geometry, direction, data):
1041
1045
... args = "{} ->{}".format(vfile, ofile.name)
1042
1046
... lib.call_module("info", args)
1043
1047
... print(ofile.read().strip())
1048
+ ...
1044
1049
<vector memory>: N = 5 <0/4> <5/9>
1045
1050
1046
1051
"""
@@ -1137,6 +1142,7 @@ def virtualfile_from_vectors(self, *vectors):
1137
1142
... "info", "{} ->{}".format(fin, fout.name)
1138
1143
... )
1139
1144
... print(fout.read().strip())
1145
+ ...
1140
1146
<vector memory>: N = 3 <1/3> <4/6> <7/9>
1141
1147
1142
1148
"""
@@ -1249,6 +1255,7 @@ def virtualfile_from_matrix(self, matrix):
1249
1255
... "info", "{} ->{}".format(fin, fout.name)
1250
1256
... )
1251
1257
... print(fout.read().strip())
1258
+ ...
1252
1259
<matrix memory>: N = 4 <0/9> <1/10> <2/11>
1253
1260
1254
1261
"""
@@ -1331,6 +1338,7 @@ def virtualfile_from_grid(self, grid):
1331
1338
... args = "{} -L0 -Cn ->{}".format(fin, fout.name)
1332
1339
... ses.call_module("grdinfo", args)
1333
1340
... print(fout.read().strip())
1341
+ ...
1334
1342
-180 180 -90 90 -8182 5651.5 1 1 360 180 1 1
1335
1343
>>> # The output is: w e s n z0 z1 dx dy n_columns n_rows reg gtype
1336
1344
@@ -1387,6 +1395,7 @@ def extract_region(self):
1387
1395
... )
1388
1396
>>> with Session() as lib:
1389
1397
... wesn = lib.extract_region()
1398
+ ...
1390
1399
>>> print(", ".join(["{:.2f}".format(x) for x in wesn]))
1391
1400
0.00, 10.00, -20.00, -10.00
1392
1401
@@ -1399,6 +1408,7 @@ def extract_region(self):
1399
1408
... )
1400
1409
>>> with Session() as lib:
1401
1410
... wesn = lib.extract_region()
1411
+ ...
1402
1412
>>> print(", ".join(["{:.2f}".format(x) for x in wesn]))
1403
1413
-164.71, -154.81, 18.91, 23.58
1404
1414
@@ -1412,6 +1422,7 @@ def extract_region(self):
1412
1422
... )
1413
1423
>>> with Session() as lib:
1414
1424
... wesn = lib.extract_region()
1425
+ ...
1415
1426
>>> print(", ".join(["{:.2f}".format(x) for x in wesn]))
1416
1427
-165.00, -150.00, 15.00, 25.00
1417
1428
0 commit comments