* Add a test for generators
* Remove output annotations from decorators
Also guarded torch imports for better compatibility with
requirements.txt
* Add flag to the main meta class to skip the typecheck
* Return to the old solution
* Make async tests work
* Minor adjustments/fixing typos
* Correct Python path for new tests
* Remove some jax-dependent code
* Implement equality for MetaArrays
* Make all Dim variations frozen dataclasses
* Shorten AbstractArray methods
* Final touches
* Removing get_origin use
* Update tests with @jaxtyp
Phew, this ended up being a pretty complicated change!
The basic summary is that we now support the syntax
```
@jaxtyped(typechecker=typechecker)
def f(...): ...
```
and when using this, we now get pretty error messages about what went
wrong.
(
The old syntax, i.e.
```
@jaxtyped
@typechecker
def f(...): ...
```
is still supported, but doesn't give much information.
)
The internals of this do quite a lot of magic! In particular we
dynamically create quite a lot of functions and test the provided
arguments against their signatures. The overhead should still be
minimal under `jax.jit`, though.
(TODO: what's the overhead like in non-jit situations, e.g. PyTorch?
I've tried to minimise the overhead throughout just to be sure, but
perhaps PyTorch users should stick to the old syntax?)
Previously, something like this would not raise an error, as
variadic+broadcast dimensions were stored in a separate namespace to
variadic+nonbroadcast dimensions:
```python
def f(x: Float[Array, "*foo"], y: Float[Array, "#*foo"]):
pass
a, b = ...
assert a.shape == (3, 4)
assert b.shape == (5,)
f(a, b)
```
* Various improvements.
- Added support for functions in symbolic dimensions, e.g. "min(foo,bar)", which were previously disallowed due to the presence of a comma. (#51)
- Added support for adding ignored names to dimensions, e.g. "cols=4". (#76)
* Now works with Python 3.10 A | B union types.
This required quite a lot of refactoring! JAX supports virtual subclass registration (its metaclass is ABCMeta) but NumPy does not, so we have to actually subclass `np.ndarray`.
Simple stuff like __base__ hacking fails due to deallocator conflicts.
- Float32 introduced to replace f32 (etc.)
- Old f32 aliases were previously around for backward-compatibility, but
the code is pretty hideous, and all stakeholders are now on board
through RFC #13.
- Overall feedback was that Int{Sign,Unsign} was too long and not enough
like numpy. Changed to Int, UInt, and Integer.