Skip to content

Commit e6418dd

Browse files
authored
make modules private (#141)
* make modules private * fix import * changelog
1 parent 05c60be commit e6418dd

File tree

10 files changed

+18
-16
lines changed

10 files changed

+18
-16
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
| seaborn | 0.12 | 0.13 |
1616
| xarray | 2022.12| 2023.9 |
1717

18+
- The modules ``cartopy_utils``, ``colormaps``, ``map_layout``, ``mpl``, and ``xrcompat`` were renamed (added a leading underscore) to indicate that they are private ([#141](https://github.com/mathause/mplotutils/pull/141)).
19+
1820
### Enhancements
1921

2022
- Added convenience functions to draw hatches and add stippling:

mplotutils/__init__.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22

33
from importlib.metadata import version as _get_version
44

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 (
5+
from mplotutils import _cartopy_utils, _colorbar, _colormaps
6+
from mplotutils._cartopy_utils import (
107
cyclic_dataarray,
118
sample_data_map,
129
sample_dataarray,
@@ -15,20 +12,23 @@
1512
ylabel_map,
1613
yticklabels,
1714
)
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
15+
from mplotutils._colorbar import colorbar
16+
from mplotutils._colormaps import from_levels_and_cmap
17+
from mplotutils._hatch import hatch, hatch_map, hatch_map_global
18+
from mplotutils._map_layout import set_map_layout
19+
from mplotutils._mpl import _get_renderer
20+
from mplotutils._savefig import autodraw
21+
from mplotutils._xrcompat import infer_interval_breaks
2222

2323
autodraw(True)
2424

2525
__all__ = [
2626
"_colorbar",
2727
"_get_renderer",
2828
"autodraw",
29-
"cartopy_utils",
29+
"_cartopy_utils",
3030
"colorbar",
31-
"colormaps",
31+
"_colormaps",
3232
"cyclic_dataarray",
3333
"from_levels_and_cmap",
3434
"hatch_map_global",

mplotutils/cartopy_utils.py renamed to mplotutils/_cartopy_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
import shapely.geometry
77
from cartopy.mpl.gridliner import LATITUDE_FORMATTER, LONGITUDE_FORMATTER
88

9+
from mplotutils._colormaps import _get_label_attr
910
from mplotutils._deprecate import _deprecate_positional_args
10-
from mplotutils.colormaps import _get_label_attr
1111

1212

1313
def sample_data_map(nlons, nlats):
File renamed without changes.

mplotutils/_hatch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
_HATCHES_PER_FIGURE = {}
1111

1212

13-
from mplotutils.mpl import _maybe_gca
13+
from mplotutils._mpl import _maybe_gca
1414

1515

1616
def hatch(da, hatch, *, ax=None, label=None, linewidth=None, color="0.1"):

mplotutils/map_layout.py renamed to mplotutils/_map_layout.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from mpl_toolkits.axes_grid1 import AxesGrid
77

88
from mplotutils._deprecate import _deprecate_positional_args
9-
from mplotutils.mpl import _get_renderer
9+
from mplotutils._mpl import _get_renderer
1010

1111

1212
@_deprecate_positional_args("0.3")
File renamed without changes.
File renamed without changes.

mplotutils/tests/test_infer_interval_breaks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import pytest
33
from numpy.testing import assert_array_equal # noqa: F401
44

5-
from mplotutils.xrcompat import _infer_interval_breaks, infer_interval_breaks
5+
from mplotutils._xrcompat import _infer_interval_breaks, infer_interval_breaks
66

77

88
def test_infer_interval_breaks_warns():

mplotutils/tests/test_maybe_gca.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import matplotlib as mpl
22
import matplotlib.pyplot as plt
33

4-
from mplotutils.mpl import _maybe_gca
4+
from mplotutils._mpl import _maybe_gca
55

66
from . import figure_context
77

0 commit comments

Comments
 (0)