8000 Backward compatibility for the privatized matplotlib.tri modules · matplotlib/matplotlib@25f77d7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 25f77d7

Browse files
committed
Backward compatibility for the privatized matplotlib.tri modules
1 parent cf8e04d commit 25f77d7

File tree

11 files changed

+80
-3
lines changed

11 files changed

+80
-3
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
63
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ per-file-ignores =
6060
lib/matplotlib/pyplot.py: F401, F811
6161
lib/matplotlib/tests/test_mathtext.py: E501
6262
lib/matplotlib/transforms.py: E201, E202, E203
63-
lib/matplotlib/tri/triinterpolate.py: E201, E221
+
lib/matplotlib/tri/_triinterpolate.py: E201, E221
6464
lib/mpl_toolkits/axes_grid1/axes_size.py: E272
6565
lib/mpl_toolkits/axisartist/__init__.py: F401
6666
lib/mpl_toolkits/axisartist/angle_helper.py: E221
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
``matplotlib.tri`` submodules are deprecated
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
The ``matplotlib.tri.*`` submodules are deprecated. All functionality is
5+
available in ``matplotlib.tri`` directly and should be imported from there.

lib/matplotlib/tests/test_triangulation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,8 +621,8 @@ def poisson_sparse_matrix(n, m):
621621
for itest in range(n*m):
622622
b = np.zeros(n*m, dtype=np.float64)
623623
b[itest] = 1.
624-
x, _ = mtri.triinterpolate._cg(A=mat, b=b, x0=np.zeros(n*m),
625-
tol=1.e-10)
624+
x, _ = mtri._triinterpolate._cg(A=mat, b=b, x0=np.zeros(n*m),
625+
tol=1.e-10)
626626
assert_array_almost_equal(np.dot(mat_dense, x), b)
627627

628628
# 2) Same matrix with inserting 2 rows - cols with null diag terms

lib/matplotlib/tri/triangulation.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from ._triangulation import * # noqa: F401, F403
2+
from matplotlib import _api
3+
4+
5+
_api.warn_deprecated(
6+
"3.7",
7+
message=f"Importing {__name__} was deprecated in Matplotlib 3.7 and will "
8+
f"be removed two minor releases later. All functionality is "
9+
f"available via the top-level module matplotlib.tri")

lib/matplotlib/tri/tricontour.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from ._tricontour import * # noqa: F401, F403
2+
from matplotlib import _api
3+
4+
5+
_api.warn_deprecated(
6+
"3.7",
7+
message=f"Importing {__name__} was deprecated in Matplotlib 3.7 and will "
8+
f"be removed two minor releases later. All functionality is "
9+
f"available via the top-level module matplotlib.tri")

lib/matplotlib/tri/trifinder.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from ._trifinder import * # noqa: F401, F403
2+
from matplotlib import _api
3+
4+
5+
_api.warn_deprecated(
6+
"3.7",
7+
message=f"Importing {__name__} was deprecated in Matplotlib 3.7 and will "
8+
f"be removed two minor releases later. All functionality is "
9+
f"available via the top-level module matplotlib.tri")

lib/matplotlib/tri/triinterpolate.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from ._triinterpolate import * # noqa: F401, F403
2+
from matplotlib import _api
3+
4+
5+
_api.warn_deprecated(
6+
"3.7",
7+
message=f"Importing {__name__} was deprecated in Matplotlib 3.7 and will "
8+
f"be removed two minor releases later. All functionality is "
9+
f"available via the top-level module matplotlib.tri")

lib/matplotlib/tri/tripcolor.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from ._tripcolor import * # noqa: F401, F403
2+
from matplotlib import _api
3+
4+
5+
_api.warn_deprecated(
6+
"3.7",
7+
message=f"Importing {__name__} was deprecated in Matplotlib 3.7 and will "
8+
f"be removed two minor releases later. All functionality is "
9+
f"available via the top-level module matplotlib.tri")

lib/matplotlib/tri/triplot.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from ._triplot import * # noqa: F401, F403
2+
from matplotlib import _api
3+
4+
5+
_api.warn_deprecated(
6+
"3.7",
7+
message=f"Importing {__name__} was deprecated in Matplotlib 3.7 and will "
8+
f"be removed two minor releases later. All functionality is "
9+
f"available via the top-level module matplotlib.tri")

lib/matplotlib/tri/trirefine.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from ._trirefine import * # noqa: F401, F403
2+
from matplotlib import _api
3+
4+
5+
_api.warn_deprecated(
6+
"3.7",
7+
message=f"Importing {__name__} was deprecated in Matplotlib 3.7 and will "
8+
f"be removed two minor releases later. All functionality is "
9+
f"available via the top-level module matplotlib.tri")

lib/matplotlib/tri/tritools.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from ._tritools import * # noqa: F401, F403
2+
from matplotlib import _api
3+
4+
5+
_api.warn_deprecated(
6+
"3.7",
7+
message=f"Importing {__name__} was deprecated in Matplotlib 3.7 and will "
8+
f"be removed two minor releases later. All functionality is "
9+
f"available via the top-level module matplotlib.tri")

0 commit comments

Comments
 (0)
2927
0