Releases: patrick-kidger/jaxtyping
jaxtyping v0.2.36
Fixed previous release that broke Python 3.9 compatibility! (Thanks @baluyotraf! #269, #270, #271)
See https://github.com/patrick-kidger/jaxtyping/releases/tag/v0.2.35 for the corresponding release notes.
New Contributors
- @baluyotraf made their first contribution in #270
Full Changelog: v0.2.35...v0.2.36
jaxtyping v0.2.35
-
Dropped dependency on
typeguard==2.13.3
. We now vendor our own copy of this. This means thatjaxtyping
now has zero dependencies. Note that more recent versions of typeguard do still seem to be a bit buggy in their handling of jaxtyping annotations, but we're now doing everything we can on this one :) (#199, #266) -
jaxtyping no longer produces references cycles, which should improve performance in a edge cases, e.g. when decorating temporary local functions. (Thanks @ojw28! #258, #259, #260)
-
Improved compaibility with
cloudpickle
: this library has a minor bug that produced crashes in some edge cases used alongside jaxtyping -- we've now hopefully worked around such issues once and for all. (#261, #262) -
Improved compatibility with
poetry
: this library has a bug in how it interpreters~=
version constraints in a nonstandard manner. We now use>=
constraints instead. (Thanks @norpadon! #257) -
Improved compatibility with
mypy
: now adding some extra typehints to help it infer the type of a jaxtyped-decorator function. (#254, #255)
New Contributors
Full Changelog: v0.2.34...v0.2.35
jaxtyping v0.2.34
- Compatibility with
ray
-- this fixes crashes with the error messagehas no attribute 'index_variadic'
(#198, #237) - Compatibility with Python 3.12: fixed deprecation warnings about
ast.Str
. (#236, thanks @phinate!) - Error message improvements + doc improvements (#233, #240, thanks @padix-key and @jjyyxx!)
New Contributors
- @padix-key made their first contribution in #233
- @phinate made their first contribution in #236
- @jjyyxx made their first contribution in #240
Full Changelog: v0.2.33...v0.2.34
jaxtyping v0.2.33
- Compatibility with Python 3.10 when using
Any
as the array type. - Compatibility with generic array types.
- Array typevars now respect
__constraints__
Full Changelog: v0.2.32...v0.2.33
jaxtyping v0.2.32
-
The array type can now be either
Any
or aTypeVar
. In both cases this means that anything is allowed at runtime. As usual, static type checkers will only look at the array part of an annotation, so that an annotation of the formFloat[T, "foo bar"]
(whereT = TypeVar("T")
) will be treated as justT
by static type checkers. This allows for expressing array-type-polymorphism with static typechecking. Here's an example:import numpy as np import torch from typing import TypeVar TensorLike = TypeVar("TensorLike", np.ndarray, torch.Tensor) def stack_scalars(x: Float[TensorLike, ""], y: Float[TensorLike, ""]) -> Float[TensorLike, "2"]: if isinstance(x, np.ndarray) and isinstance(y, np.ndarray): return np.stack([x, y]) elif isinstance(x, torch.Tensor) and isinstance(y, torch.Tensor): return torch.stack([x, y]) else: raise ValueError("Invalid array types!")
-
Fixed a bug in which the very first argument to a function was erroneously reported as the one at fault for a typechecking error. This bug occurred when using default arguments.
Full Changelog: v0.2.31...v0.2.32
jaxtyping v0.2.31
-
Now duck-type on array shapes and dtypes, so you can use
jaxtyping
for your custom arraylike objects:class FooDtype(jaxtyping.AbstractDtype): dtypes = ["foo"] class MyArray: @property def dtype(self): return "foo" @property def shape(self): return (3, 1, 4) def f(x: FooDtype[MyArray, "3 1 4"]): ...
-
Improved compatibility when typeguard warns that you're typechecking a function without annotations: it will no longer mention the jaxtyping-internal
check_params
function and will instead mention the name of the function that is missing annotations. -
Improved the error message when typechecking fails, to state the full
some_module.SomeClass.some_method
rather than justsome_method
. -
Fixed a JAX deprecation warning for
jax.tree_map
. (Thanks @groszewn!)
New Contributors
Full Changelog: v0.2.30...v0.2.31
jaxtyping v0.2.30
- Now reporting the correct source code line numbers when using the import hook. Makes debuggers useful again! #214
- Now supports numpy structured dtypes (Thanks @alexfanqi! #211)
- Now respecting
typing.no_type_check
. #216
New Contributors
- @alexfanqi made their first contribution in #211
Full Changelog: v0.2.29...v0.2.30
jaxtyping v0.2.29
- Crash fix for when
jax
is available butjaxlib
is not. (Thanks @ar0ck! #191) - Crash fix when used alongside old TensorFlow versions that don't support
tensor.ndim
(Thanks @dziulek! #193) - Crash fix when using a default argument as a symbolic dimension size. (Thanks @jaraujo98! #208)
- Improved import times by defining the IPython magic lazily. (Thanks @superbobry! #201)
- The import hook will now typecheck functions that do not have any annotations in the arguments or return value. This is useful for those that do manual
isinstance
checks in the body of teh function. (Thanks @nimashoghi! #205) - Dropped the dependency on numpy. This makes it possible to just use jaxtyping+typeguard as the one-stop-shop for all runtime typechecking, even when you're not using arrays. Obviously that's a little unusual -- not really the main focus of jaxtyping -- but helps when wanting a single choice of runtime type checker across an entire codebase, only parts of which may use arrays. (#212)
New Contributors
- @ar0ck made their first contribution in #191
- @dziulek made their first contribution in #193
- @superbobry made their first contribution in #201
- @nimashoghi made their first contribution in #205
- @jaraujo98 made their first contribution in #208
Full Changelog: v0.2.28...v0.2.29
jaxtyping v0.2.28
Autogenerated release notes as follows:
What's Changed
- Fixes #188. by @patrick-kidger in #190
Full Changelog: v0.2.27...v0.2.28
jaxtyping v0.2.27
Quick bugfix release:
- Fixed some
isinstance
checks against variadics crashing (although this was when it was about to returnFalse
anyway). (Thanks @asford! #186) - Fixed docs for downstream libraries (Equinox, ...) not generating correctl (#182)
New Contributors
Full Changelog: v0.2.26...v0.2.27