From d38870b95f42e2bb03254dce51ec2483d446c6c8 Mon Sep 17 00:00:00 2001 From: Victor Blomqvist Date: Thu, 2 Nov 2023 15:04:44 +0100 Subject: [PATCH] prep 6.6.0 --- CHANGELOG.rst | 19 +++++++++++++++++++ CITATION.cff | 4 ++-- README.rst | 2 +- TODO.txt | 4 ++-- docs/src/ext/autoexample.py | 2 +- pymunk/_pyglet15_util.py | 5 +---- pymunk/_version.py | 4 ++-- pymunk/constraints.py | 2 +- pymunk/pygame_util.py | 2 +- pymunk/pyglet_util.py | 5 +---- pymunk/util.py | 3 +-- pymunk/vec2d.py | 8 ++++---- setup.py | 2 +- tools/create_release_win.py | 3 +-- 14 files changed, 38 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8f7df56d..6ad821b5 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,25 @@ Changelog ========= +Pymunk 6.6.0 (2023-11-02) +------------------------- + +**Experimental Batch API** + +This release adds a (experimental) batch API that can be used to efficiently +get body properties such as positions, and collision data for all bodies / +collisions in a space in one call. This way the overhead of calling the +underlying c library (Chipmunk2D) is minimized, enabling a massive speedup +in some cases. + +Changes: + +- New pymunk.batch module with batch API. +- Batch api benchmark +- Improved types +- Improve build/packaging + + Pymunk 6.5.2 (2023-10-22) ------------------------- diff --git a/CITATION.cff b/CITATION.cff index f4ceab0e..b3b2e889 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -5,6 +5,6 @@ authors: given-names: "Victor" title: "Pymunk" abstract: "A easy-to-use pythonic rigid body 2d physics library" -version: 6.5.2 -date-released: 2023-10-22 +version: 6.6.0 +date-released: 2023-11-02 url: "https://pymunk.org" diff --git a/README.rst b/README.rst index d8fb83f0..ed0c00ec 100644 --- a/README.rst +++ b/README.rst @@ -18,7 +18,7 @@ the Pymunk webpage for some examples. 2007 - 2023, Victor Blomqvist - vb@viblo.se, MIT License -This release is based on the latest Pymunk release (6.5.2), +This release is based on the latest Pymunk release (6.6.0), using Chipmunk 7 rev 5dd7d774053145fa37f352d7a07d2f75a9bd8039. diff --git a/TODO.txt b/TODO.txt index 2f26c4c4..8fa66e24 100644 --- a/TODO.txt +++ b/TODO.txt @@ -32,8 +32,8 @@ v6.x - Catch error when NaN in debugdraw, suggest doublecheck mass=0. https://github.com/viblo/pymunk/issues/226 - Make benchmark between pymunk and pybullet. 2d bullet inspiration: https://github.com/bulletphysics/bullet3/blob/2.83/examples/Planar2D/Planar2D.cpp - Remove support for Python 3.7 (check https://pypistats.org/packages/pymunk first) -- Make batched api part of "public" pymunk api, usable without using cffi methods directly. -- Expand batched api. In https://github.com/viblo/pymunk/issues/235 he would like to have batched contact info as well. +- After a couple of versions / time passed, re-evaluate if batch api should be separate or merged in to space. +- Think about the copyright notice in some files. Keep / put everywere / remove? v7+ (all potentially breaking changes) --- diff --git a/docs/src/ext/autoexample.py b/docs/src/ext/autoexample.py index 0e2cfb0d..5b966623 100644 --- a/docs/src/ext/autoexample.py +++ b/docs/src/ext/autoexample.py @@ -1,5 +1,5 @@ # ---------------------------------------------------------------------------- -# Copyright (c) 2007-2022 Victor Blomqvist +# Copyright (c) 2007-2023 Victor Blomqvist # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/pymunk/_pyglet15_util.py b/pymunk/_pyglet15_util.py index 4a30cbee..38528876 100644 --- a/pymunk/_pyglet15_util.py +++ b/pymunk/_pyglet15_util.py @@ -1,6 +1,6 @@ # ---------------------------------------------------------------------------- # pymunk -# Copyright (c) 2007-2016 Victor Blomqvist +# Copyright (c) 2007-2023 Victor Blomqvist # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -123,7 +123,6 @@ def draw_circle( outline_color: SpaceDebugColor, fill_color: SpaceDebugColor, ) -> None: - bg = pyglet.graphics.OrderedGroup(0) fg = pyglet.graphics.OrderedGroup(1) @@ -155,7 +154,6 @@ def draw_fat_segment( outline_color: SpaceDebugColor, fill_color: SpaceDebugColor, ) -> None: - c = fill_color.as_int() pv1 = a pv2 = b @@ -183,7 +181,6 @@ def draw_polygon( outline_color: SpaceDebugColor, fill_color: SpaceDebugColor, ) -> None: - c = fill_color.as_int() s = pyglet.shapes.Polygon(*verts, color=c[:3], batch=self.batch) self.draw_shapes.append(s) diff --git a/pymunk/_version.py b/pymunk/_version.py index 6414eca7..d68148af 100644 --- a/pymunk/_version.py +++ b/pymunk/_version.py @@ -1,6 +1,6 @@ # ---------------------------------------------------------------------------- # pymunk -# Copyright (c) 2007-2020 Victor Blomqvist +# Copyright (c) 2007-2023 Victor Blomqvist # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -32,7 +32,7 @@ cp = _chipmunk_cffi.lib ffi = _chipmunk_cffi.ffi -version = "6.5.2" +version = "6.6.2" chipmunk_version = "%s-%s" % ( ffi.string(cp.cpVersionString).decode("utf-8"), diff --git a/pymunk/constraints.py b/pymunk/constraints.py index 65524bed..bd5b2d25 100644 --- a/pymunk/constraints.py +++ b/pymunk/constraints.py @@ -1,6 +1,6 @@ # ---------------------------------------------------------------------------- # pymunk -# Copyright (c) 2007-2017 Victor Blomqvist +# Copyright (c) 2007-2023 Victor Blomqvist # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/pymunk/pygame_util.py b/pymunk/pygame_util.py index 9b871fd0..572c4c38 100644 --- a/pymunk/pygame_util.py +++ b/pymunk/pygame_util.py @@ -1,6 +1,6 @@ # ---------------------------------------------------------------------------- # pymunk -# Copyright (c) 2007-2016 Victor Blomqvist +# Copyright (c) 2007-2023 Victor Blomqvist # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/pymunk/pyglet_util.py b/pymunk/pyglet_util.py index bb33bd2c..bda0b658 100644 --- a/pymunk/pyglet_util.py +++ b/pymunk/pyglet_util.py @@ -1,6 +1,6 @@ # ---------------------------------------------------------------------------- # pymunk -# Copyright (c) 2007-2016 Victor Blomqvist +# Copyright (c) 2007-2023 Victor Blomqvist # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -114,7 +114,6 @@ def draw_circle( outline_color: SpaceDebugColor, fill_color: SpaceDebugColor, ) -> None: - bg = pyglet.graphics.Group(0) fg = pyglet.graphics.Group(1) @@ -143,7 +142,6 @@ def draw_fat_segment( outline_color: SpaceDebugColor, fill_color: SpaceDebugColor, ) -> None: - c = fill_color.as_int() pv1 = a pv2 = b @@ -173,7 +171,6 @@ def draw_polygon( outline_color: SpaceDebugColor, fill_color: SpaceDebugColor, ) -> None: - vs = [(v.x, v.y) for v in verts] c = fill_color.as_int() diff --git a/pymunk/util.py b/pymunk/util.py index 3e2567df..dd8e3744 100644 --- a/pymunk/util.py +++ b/pymunk/util.py @@ -1,6 +1,6 @@ # ---------------------------------------------------------------------------- # pymunk -# Copyright (c) 2007-2016 Victor Blomqvist +# Copyright (c) 2007-2023 Victor Blomqvist # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -161,7 +161,6 @@ def convex_hull(points): hull = [p0, points[1]] for p in points[2:]: - pt1 = hull[-1] pt2 = hull[-2] l = is_left(pt2, pt1, p) diff --git a/pymunk/vec2d.py b/pymunk/vec2d.py index 14c837e0..db6567a0 100644 --- a/pymunk/vec2d.py +++ b/pymunk/vec2d.py @@ -1,6 +1,6 @@ # ---------------------------------------------------------------------------- # pymunk -# Copyright (c) 2007-2020 Victor Blomqvist +# Copyright (c) 2007-2023 Victor Blomqvist # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -191,7 +191,7 @@ def get_length_sqrd(self) -> float: :return: The squared length """ - return self.x ** 2 + self.y ** 2 + return self.x**2 + self.y**2 @property def length(self) -> float: @@ -204,7 +204,7 @@ def length(self) -> float: :return: The length """ - return math.sqrt(self.x ** 2 + self.y ** 2) + return math.sqrt(self.x**2 + self.y**2) def scale_to_length(self, length: float) -> "Vec2d": """Return a copy of this vector scaled to the given length. @@ -394,7 +394,7 @@ def ones() -> "Vec2d": # Extra functions, mainly for chipmunk def cpvrotate(self, other: Tuple[float, float]) -> "Vec2d": - """Uses complex multiplication to rotate this vector by the other. """ + """Uses complex multiplication to rotate this vector by the other.""" assert len(other) == 2 return Vec2d( self.x * other[0] - self.y * other[1], self.x * other[1] + self.y * other[0] diff --git a/setup.py b/setup.py index 48699ef8..4686ca57 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ url="http://www.pymunk.org", author="Victor Blomqvist", author_email="vb@viblo.se", - version="6.5.2", # remember to change me for new versions! + version="6.6.0", # remember to change me for new versions! description="Pymunk is a easy-to-use pythonic 2d physics library", long_description=long_description, packages=packages, diff --git a/tools/create_release_win.py b/tools/create_release_win.py index 1a929ff4..5d28d59d 100644 --- a/tools/create_release_win.py +++ b/tools/create_release_win.py @@ -9,10 +9,9 @@ def main(): """ Remember (before running this script!): - change version number in README.rst, setup.py, CITATION.cff and _version.py - - write entry in CHANGELOG.rst + - write changelog entry in CHANGELOG.rst - test in at least CPython 3.x and Pypy3 - validate test results of Github Actions - - write changelog entry and put in changelog.rst - make sure all images are optimized (for example with tinypng.com) - generate docs before running sdist - Make sure cffi extensions included in wheel and zip!!!!