Skip to content

Commit 3f549e1

Browse files
committed
Deprecated matplotlib_util
1 parent daaaee9 commit 3f549e1

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ Changelog
77
Added Vec2d.length_squared, and depreacted Vec2d.get_length_sqrd()
88
Added Vec2d.get_distance_squared(), and deprecated Vec2d.get_dist_sqrd()
99
A dynamic body must have non-zero mass when calling Space.step (either from Body.mass, or by setting mass or density on a Shape attached to the Body). Its not valid to set mass to 0 on a dynamic body attached to a space.
10-
10+
Deprecated matplotlib_util. If you think this is a useful module and you use it, please create an issue on the Pymunk issue track
11+
1112
Added default do_nothing and always_collide callback functions to the CollisionHandler, so that its clear how to reset and align with other callbacks.
1213
If in old code you did handler.begin = None, you should now instead to handler.begin = CollisionHandler.always_collide etc.
1314

TODO.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ v6.x
4444
- Add Canvas util module (after pyodide)
4545
- Use https://diataxis.fr/ method of organizing docs (tutorials, how-to, explanation, reference)
4646
- Make sure cffi extensions included in wheel and zip!
47-
- Catch error when NaN in debugdraw, suggest doublecheck mass=0. https://github.com/viblo/pymunk/issues/226 and https://github.com/viblo/pymunk/issues/267
4847
- Make benchmark between pymunk and pybullet. 2d bullet inspiration: https://github.com/bulletphysics/bullet3/blob/2.83/examples/Planar2D/Planar2D.cpp
4948
- After a couple of versions / time passed, re-evaluate if batch api should be separate or merged in to space.
5049
- Think about the copyright notice in some files. Keep / put everywere / remove?

pymunk/matplotlib_util.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
"""This submodule contains helper functions to help with quick prototyping
1+
"""This submodule contains helper functions to help with quick prototyping
22
using pymunk together with matplotlib.
33
44
Intended to help with debugging and prototyping, not for actual production use
5-
in a full application. The methods contained in this module is opinionated
6-
about your coordinate system and not very optimized.
5+
in a full application. The methods contained in this module is opinionated
6+
about your coordinate system and not very optimized.
77
"""
88

99
__docformat__ = "reStructuredText"
1010

11+
import warnings
1112
from typing import TYPE_CHECKING, Any, Sequence
1213

1314
import matplotlib.pyplot as plt # type: ignore
@@ -43,11 +44,26 @@ def __init__(self, ax: Any) -> None:
4344
4445
See matplotlib_util.demo.py for a full example
4546
47+
.. deprecated:: 7.0.0
48+
If you find this class useful, please open an issue on the pymunk
49+
issue tracker at https://github.com/viblo/pymunk/issues Otherwise
50+
this is likely to be completely removed in a future Pymunk version.
51+
52+
4653
:Param:
4754
ax: matplotlib.Axes
4855
A matplotlib Axes object.
4956
5057
"""
58+
warnings.warn(
59+
"matplotlib_util.DrawOptions is deprecated. If you find it useful, "
60+
"please open an issue on the pymunk issue tracker at "
61+
"https://github.com/viblo/pymunk/issues Otherwise this is likely "
62+
"to be completely removed in a future Pymunk version.",
63+
category=DeprecationWarning,
64+
stacklevel=2,
65+
)
66+
5167
super(DrawOptions, self).__init__()
5268

5369
self.ax = ax

0 commit comments

Comments
 (0)