Skip to content

Commit 6c7a673

Browse files
authored
Convert relative imports to absolute imports (#754)
1 parent 7245861 commit 6c7a673

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+169
-170
lines changed

.pylintrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,7 @@ min-public-methods=2
538538

539539
# List of modules that can be imported at any level, not just the top level
540540
# one.
541-
allow-any-import-level=clib,
542-
clib.Session,
541+
allow-any-import-level=pygmt.clib.Session,
543542
sys,
544543
platform,
545544
importlib,

pygmt/__init__.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
from pkg_resources import get_distribution
1313

1414
# Import modules to make the high-level GMT Python API
15-
from .session_management import begin as _begin, end as _end
16-
from .figure import Figure
17-
from .filtering import blockmedian
18-
from .gridding import surface
19-
from .sampling import grdtrack
20-
from .mathops import makecpt
21-
from .modules import GMTDataArrayAccessor, config, info, grdinfo, which
22-
from .gridops import grdcut, grdfilter
23-
from .x2sys import x2sys_init, x2sys_cross
24-
from . import datasets
15+
from pygmt.session_management import begin as _begin, end as _end
16+
from pygmt.figure import Figure
17+
from pygmt.filtering import blockmedian
18+
from pygmt.gridding import surface
19+
from pygmt.sampling import grdtrack
20+
from pygmt.mathops import makecpt
21+
from pygmt.modules import GMTDataArrayAccessor, config, info, grdinfo, which
22+
from pygmt.gridops import grdcut, grdfilter
23+
from pygmt.x2sys import x2sys_init, x2sys_cross
24+
from pygmt import datasets
2525

2626
# Get semantic version through setuptools-scm
2727
__version__ = f'v{get_distribution("pygmt").version}' # e.g. v0.1.2.dev3+g0ab3cd78
@@ -40,7 +40,7 @@ def print_clib_info():
4040
Includes the GMT version, default values for parameters, the path to the
4141
``libgmt`` shared library, and GMT directories.
4242
"""
43-
from .clib import Session
43+
from pygmt.clib import Session
4444

4545
lines = ["GMT library information:"]
4646
with Session() as ses:

pygmt/base_plotting.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import numpy as np
77
import pandas as pd
88

9-
from .clib import Session
10-
from .exceptions import GMTError, GMTInvalidInput
11-
from .helpers import (
9+
from pygmt.clib import Session
10+
from pygmt.exceptions import GMTError, GMTInvalidInput
11+
from pygmt.helpers import (
1212
build_arg_string,
1313
dummy_context,
1414
data_kind,

pygmt/clib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
# The pygmt.clib.Session class wraps the GMT C shared library (libgmt) with a
66
# pythonic interface. Access to the C library is done through ctypes.
77

8-
from .session import Session
8+
from pygmt.clib.session import Session

pygmt/clib/conversion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import numpy as np
55
import pandas as pd
66

7-
from ..exceptions import GMTInvalidInput
7+
from pygmt.exceptions import GMTInvalidInput
88

99

1010
def dataarray_to_matrix(grid):

pygmt/clib/loading.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import ctypes
1010
from ctypes.util import find_library
1111

12-
from ..exceptions import GMTOSError, GMTCLibError, GMTCLibNotFoundError
12+
from pygmt.exceptions import GMTOSError, GMTCLibError, GMTCLibNotFoundError
1313

1414

1515
def load_libgmt():

pygmt/clib/session.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
import numpy as np
1212
import pandas as pd
1313

14-
from ..exceptions import (
14+
from pygmt.exceptions import (
1515
GMTCLibError,
1616
GMTCLibNoSessionError,
1717
GMTInvalidInput,
1818
GMTVersionError,
1919
)
20-
from .loading import load_libgmt
21-
from .conversion import (
20+
from pygmt.clib.loading import load_libgmt
21+
from pygmt.clib.conversion import (
2222
kwargs_to_ctypes_array,
2323
vectors_to_arrays,
2424
dataarray_to_matrix,

pygmt/datasets/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
#
33
# Load sample data included with GMT (downloaded from the GMT cache server).
44

5-
from .tutorial import (
5+
from pygmt.datasets.tutorial import (
66
load_japan_quakes,
77
load_ocean_ridge_points,
88
load_sample_bathymetry,
99
load_usgs_quakes,
1010
)
11-
from .earth_relief import load_earth_relief
11+
from pygmt.datasets.earth_relief import load_earth_relief

pygmt/datasets/earth_relief.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"""
55
import xarray as xr
66

7-
from .. import grdcut, which
8-
from ..exceptions import GMTInvalidInput
9-
from ..helpers import kwargs_to_strings
7+
from pygmt import grdcut, which
8+
from pygmt.exceptions import GMTInvalidInput
9+
from pygmt.helpers import kwargs_to_strings
1010

1111

1212
@kwargs_to_strings(region="sequence")

pygmt/datasets/tutorial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44
import pandas as pd
55

6-
from .. import which
6+
from pygmt import which
77

88

99
def load_japan_quakes():

0 commit comments

Comments
 (0)