Skip to content

Commit

Permalink
make modules private (#141)
Browse files Browse the repository at this point in the history
* make modules private

* fix import

* changelog
  • Loading branch information
mathause authored Nov 4, 2024
1 parent 05c60be commit e6418dd
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 16 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
| seaborn | 0.12 | 0.13 |
| xarray | 2022.12| 2023.9 |

- 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)).

### Enhancements

- Added convenience functions to draw hatches and add stippling:
Expand Down
22 changes: 11 additions & 11 deletions mplotutils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@

from importlib.metadata import version as _get_version

from mplotutils import _colorbar, cartopy_utils, colormaps
from mplotutils._colorbar import colorbar
from mplotutils._hatch import hatch, hatch_map, hatch_map_global
from mplotutils._savefig import autodraw
from mplotutils.cartopy_utils import (
from mplotutils import _cartopy_utils, _colorbar, _colormaps
from mplotutils._cartopy_utils import (
cyclic_dataarray,
sample_data_map,
sample_dataarray,
Expand All @@ -15,20 +12,23 @@
ylabel_map,
yticklabels,
)
from mplotutils.colormaps import from_levels_and_cmap
from mplotutils.map_layout import set_map_layout
from mplotutils.mpl import _get_renderer
from mplotutils.xrcompat import infer_interval_breaks
from mplotutils._colorbar import colorbar
from mplotutils._colormaps import from_levels_and_cmap
from mplotutils._hatch import hatch, hatch_map, hatch_map_global
from mplotutils._map_layout import set_map_layout
from mplotutils._mpl import _get_renderer
from mplotutils._savefig import autodraw
from mplotutils._xrcompat import infer_interval_breaks

autodraw(True)

__all__ = [
"_colorbar",
"_get_renderer",
"autodraw",
"cartopy_utils",
"_cartopy_utils",
"colorbar",
"colormaps",
"_colormaps",
"cyclic_dataarray",
"from_levels_and_cmap",
"hatch_map_global",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import shapely.geometry
from cartopy.mpl.gridliner import LATITUDE_FORMATTER, LONGITUDE_FORMATTER

from mplotutils._colormaps import _get_label_attr
from mplotutils._deprecate import _deprecate_positional_args
from mplotutils.colormaps import _get_label_attr


def sample_data_map(nlons, nlats):
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion mplotutils/_hatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
_HATCHES_PER_FIGURE = {}


from mplotutils.mpl import _maybe_gca
from mplotutils._mpl import _maybe_gca


def hatch(da, hatch, *, ax=None, label=None, linewidth=None, color="0.1"):
Expand Down
2 changes: 1 addition & 1 deletion mplotutils/map_layout.py → mplotutils/_map_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from mpl_toolkits.axes_grid1 import AxesGrid

from mplotutils._deprecate import _deprecate_positional_args
from mplotutils.mpl import _get_renderer
from mplotutils._mpl import _get_renderer


@_deprecate_positional_args("0.3")
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion mplotutils/tests/test_infer_interval_breaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pytest
from numpy.testing import assert_array_equal # noqa: F401

from mplotutils.xrcompat import _infer_interval_breaks, infer_interval_breaks
from mplotutils._xrcompat import _infer_interval_breaks, infer_interval_breaks


def test_infer_interval_breaks_warns():
Expand Down
2 changes: 1 addition & 1 deletion mplotutils/tests/test_maybe_gca.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import matplotlib as mpl
import matplotlib.pyplot as plt

from mplotutils.mpl import _maybe_gca
from mplotutils._mpl import _maybe_gca

from . import figure_context

Expand Down

0 comments on commit e6418dd

Please sign in to comment.