Releases: ppb/ppb-vector
Version 1.0
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 onmath.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 toVector
(#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 theVector2
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 whenself * 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)
- raise
Non-functional changes since v0.3
Version 1.0-rc1
Version 1.0-beta1
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 toVector
(#149)- Making subclasses of
Vector
now isn't supported (#149)
For new features, see the release notes for:
Version 1.0-alpha3
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
Release candidate prior to ppb-vector v1.0
.
Breaking changes since 1.0a1
New features
Version 0.4.0-rc1
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 onmath.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
Version 1.0-alpha1
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 arel_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
Bug fixes since 0.4.0rc1
Version 0.3
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)