Skip to content

Commit 38b9aca

Browse files
committed
clib: Search and load the GMT library only one time
1 parent bb82345 commit 38b9aca

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pygmt/clib/session.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
tempfile_from_image,
3535
)
3636

37+
__libgmt__ = load_libgmt()
38+
3739
FAMILIES = [
3840
"GMT_IS_DATASET", # Entity is a data table
3941
"GMT_IS_GRID", # Entity is a grid
@@ -308,7 +310,7 @@ def get_libgmt_func(self, name, argtypes=None, restype=None):
308310
<class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>
309311
"""
310312
if not hasattr(self, "_libgmt"):
311-
self._libgmt = load_libgmt()
313+
self._libgmt = __libgmt__
312314
function = getattr(self._libgmt, name)
313315
if argtypes is not None:
314316
function.argtypes = argtypes

0 commit comments

Comments
 (0)