Skip to content

Releases: ppb/ppb-vector

Version 1.0

07 Jul 18:55
Compare
Choose a tag to compare

This is the first release of ppb-vector where we commit to API stability. 🎉

This is also the first stable release since v0.3, about a year and a half ago, and a lot changed since then.
There were no changes since v1.0b1.

What's new since v0.3!

  • Vectors are now 3× smaller and most methods saw a speedup between 30% and 50%. (#115)
    This is thanks to using __slots__ to reserve space for the coordinates.
  • There's a reference documentation for the API, available in your favorite IDE, and on Read The Docs. (#130)
  • There are annotations for type-checkers such as mypy.
  • We added a bunch of new methods:
    • angle, for computing the angle between 2 vectors; (#57, #68)
      it uses a numerically-stable formula (based on math.atan2) to guarantee adequate behaviour;
    • isclose, for checking whether 2 vectors are approximately equal; (#62, #64)
    • the / operator, vector-scalar division: v / λ is (mostly) equivalent to (1 / λ) * v; (#79)
    • the + operator now supports adding vectors to vector-likes: (0, 1) + Vector(1, 0); (#151)
    • we made non-null vectors truth-y, and (0, 0) false-y. (#166)

Breaking changes since v0.3

  • Vectors are now immutable, as implemented by @dataclass(frozen=True) (#106)
  • Vector2 was renamed to Vector (#149)
  • Making subclasses of Vector isn't supported anymore (#149)

Improvements since v0.3

  • All methods support vector-likes. (#56)
  • Do not memoize the vector length, reducing memory usage at no computational cost. (#71)
  • Vector2 is now a dataclass, and as such support all related introspection functions, dataclasses.update, ... (#106)
  • asdict is a new method for converting vectors to vector-like dictionaries (#108).
  • rotate now uses higher-precision trigonometry, and better preserves vector lengths. (#89)
  • scale_to is now more precise, at the cost of possible overflows with vectors larger than 1e75. (#87)
  • Passing a Vector2 instance to the Vector2 constructor doesn't return a new object anymore. (#142)
    This is correct, as vectors are immutable, and saves up memory and time.
  • Support the pickle protocol (#147)
  • The update() method now has a more efficient implementation. (#167)

Bug fixes since v0.3

  • reflect was previously producing incorrect results when self * surface_normal > 0. (#63)
  • rotate was previously rounding its results, causing imprecision issues. (#67)
  • scale_to now deals correctly with invalid inputs (#81):
    • raise ValueError when passed a negative length;
    • raise ZeroDivisionError when scaling the null vector to a non-null length. (#95)

Non-functional changes since v0.3

  • Officially committed to semantic versioning (#165)
  • Automated our release process (#161, #170) to build and upload new versions to Github and PyPI (currently, test.pypi.org).

Version 1.0-rc1

27 Jun 07:36
Compare
Choose a tag to compare
Version 1.0-rc1 Pre-release
Pre-release

Changes since 1.0b1

  • ppb_vector's version number is now exposed as ppb_vector.__version__. (#176)
  • Docstring were improved in various ways. (#173)

Version 1.0-beta1

08 Jun 22:10
Compare
Choose a tag to compare
Version 1.0-beta1 Pre-release
Pre-release

This is the first beta for ppb-vector v1.0.
We expect this beta to become version 1.0 in a week or so.

What's new since v1.0a3

We automated our release process (#161, #170) to build and upload new versions to Github and PyPI (currently, test.pypi.org).

What's new since the last stable release (v0.3)

There were breaking changes:

  • Vectors are now immutable, as implemented by @dataclass(frozen=True) (#106)
  • Vector2 was renamed to Vector (#149)
  • Making subclasses of Vector now isn't supported (#149)

For new features, see the release notes for:

Version 1.0-alpha3

06 Jun 15:04
Compare
Choose a tag to compare
Version 1.0-alpha3 Pre-release
Pre-release

Added:

  • Add support for bool(): non-null vectors are truth-y, and (0, 0) is false-y.
  • Officially commit to semantic versioning.

Changed:

  • The update() method now has a more efficient implementation

Version 1.0-alpha2

25 May 20:36
Compare
Choose a tag to compare
Version 1.0-alpha2 Pre-release
Pre-release

Release candidate prior to ppb-vector v1.0.

Breaking changes since 1.0a1

  • Renamed Vector2 to Vector (#149)
  • Dropped support for making subclasses of Vector (#149)

New features

  • Implement __radd__ so vectors can be added to vector-likes (such as (0, 1) + Vector(1, 0) (#151)
  • Support the pickle protocol (#147)

Version 0.4.0-rc1

25 May 21:07
eb6e40c
Compare
Choose a tag to compare
Version 0.4.0-rc1 Pre-release
Pre-release

First release candidate for 0.4

New features & improvements since 0.3

  • All methods support vector-likes (#56)
  • The caret operator (x ^ y) provides cross-product computations between vectors (#57)
  • Vector2.angle is a new method for computing the angle between 2 vectors (#57, #68)
    It uses a numerically-stable formula (based on math.atan2) to guarantee adequate behaviour.
  • Vector2.isclose is a new method for checking whether 2 vectors are approximately equal (#62)
  • Provide annotations for type-checkers such as mypy
  • Do not memoize the vector length (#71)

Bug fixes since 0.3

  • Vector2.reflect was previously producing incorrect results when self * surface_normal > 0 (#63)
  • Vector2.rotate was previously rounding its results, causing imprecision issues (#67)

Version 1.0-alpha1

25 May 21:48
Compare
Choose a tag to compare
Version 1.0-alpha1 Pre-release
Pre-release

Getting a pre-release onto PyPI allows us to unblock PPB and more easily get feedback from any testers.
Note that this is not expected to be final, as there are clearly issues we want to resolve before 1.0.

Breaking changes since 0.4.0rc1

  • Vectors are now immutable, as implemented by @dataclass(frozen=True) (#106)
  • The cross-product operator (x ^ y), introduced in 0.4.0rc1, is now removed. (#80)
    This is because its implementation was numerically unstable, and its only user (Vector2.angle) switched to a different method.

New features & improvements since 0.4.0rc1

  • Provide an API reference documentation in docstrings and on Read The Docs.

  • Vector2 is now a dataclass, and as such support all related introspection functions, dataclasses.update, ... (#106)

  • Vector2.asdict is a new method for converting vectors to vector-like dictionaries (#108).

  • Vector2.isclose supports a rel_to argument, to specify additional inputs that are considered for relative error (#64)

  • Vector2.rotate now uses higher-precision trigonometry, and better preserves vector lengths. (#89)

  • Vector2.scale_to is now more precise, at the cost of possible overflows with vectors larger than 1e75. (#87)

  • Support the / operator for vector-scalar division: v / λ is (mostly) equivalent to (1 / λ) * v. (#79)

  • Various performance improvements

    • Reserve space for the coordinates using __slots__ (#115)
      Vectors are now 3× smaller and most methods saw a 30%-50% speedup.
    • Passing a Vector2 instance to the Vector2 constructor doesn't return a new object anymore. (#142)
      This is correct, as vectors are immutable, and saves up memory and time.

Bug fixes since 0.4.0rc1

  • Vector2.scale_to now deals correctly with invalid inputs (#81):
    • raise ValueError when passed a negative length;
    • raise ZeroDivisionError when scaling the null vector to a non-null length. (#95)
  • Vector2.isclose now raises ValueError on negative tolerances. (#96)

Version 0.3

02 Jan 00:45
8ee8129
Compare
Choose a tag to compare

New features:

  • Vector is a proper Iterable, use like a tuple!
  • New Reflect Method: Don't look up the matrix transform for a reflection again.
  • Vector negation: -Vector(1, 1) == Vector(-1, -1)