Skip to content

Commit 05c60be

Browse files
authored
explicit imports and __all__ (#140)
1 parent 0ea0704 commit 05c60be

File tree

2 files changed

+41
-11
lines changed

2 files changed

+41
-11
lines changed

mplotutils/__init__.py

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,49 @@
22

33
from importlib.metadata import version as _get_version
44

5-
from . import _colorbar, cartopy_utils, colormaps
6-
from ._colorbar import *
7-
from ._hatch import hatch, hatch_map, hatch_map_global
8-
from ._savefig import autodraw
9-
from .cartopy_utils import *
10-
from .colormaps import *
11-
from .map_layout import set_map_layout
12-
from .mpl import _get_renderer
13-
from .xrcompat import *
5+
from mplotutils import _colorbar, cartopy_utils, colormaps
6+
from mplotutils._colorbar import colorbar
7+
from mplotutils._hatch import hatch, hatch_map, hatch_map_global
8+
from mplotutils._savefig import autodraw
9+
from mplotutils.cartopy_utils import (
10+
cyclic_dataarray,
11+
sample_data_map,
12+
sample_dataarray,
13+
xlabel_map,
14+
xticklabels,
15+
ylabel_map,
16+
yticklabels,
17+
)
18+
from mplotutils.colormaps import from_levels_and_cmap
19+
from mplotutils.map_layout import set_map_layout
20+
from mplotutils.mpl import _get_renderer
21+
from mplotutils.xrcompat import infer_interval_breaks
1422

1523
autodraw(True)
1624

25+
__all__ = [
26+
"_colorbar",
27+
"_get_renderer",
28+
"autodraw",
29+
"cartopy_utils",
30+
"colorbar",
31+
"colormaps",
32+
"cyclic_dataarray",
33+
"from_levels_and_cmap",
34+
"hatch_map_global",
35+
"hatch_map",
36+
"hatch",
37+
"infer_interval_breaks",
38+
"sample_data_map",
39+
"sample_dataarray",
40+
"set_map_layout",
41+
"xlabel_map",
42+
"xticklabels",
43+
"ylabel_map",
44+
"yticklabels",
45+
]
46+
47+
1748
try:
1849
__version__ = _get_version("mplotutils")
1950
except Exception:

mplotutils/cartopy_utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
from cartopy.mpl.gridliner import LATITUDE_FORMATTER, LONGITUDE_FORMATTER
88

99
from mplotutils._deprecate import _deprecate_positional_args
10-
11-
from .colormaps import _get_label_attr
10+
from mplotutils.colormaps import _get_label_attr
1211

1312

1413
def sample_data_map(nlons, nlats):

0 commit comments

Comments
 (0)