Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency jaxtyping to v0.2.33 #110

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented May 27, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
jaxtyping 0.2.28 -> 0.2.33 age adoption passing confidence

Release Notes

google/jaxtyping (jaxtyping)

v0.2.33: jaxtyping v0.2.33

Compare Source

  • Compatibility with Python 3.10 when using Any as the array type.
  • Compatibility with generic array types.
  • Array typevars now respect __constraints__

Full Changelog: patrick-kidger/jaxtyping@v0.2.32...v0.2.33

v0.2.32: jaxtyping v0.2.32

Compare Source

  • The array type can now be either Any or a TypeVar. 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 form Float[T, "foo bar"] (where T = TypeVar("T")) will be treated as just T 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: patrick-kidger/jaxtyping@v0.2.31...v0.2.32

v0.2.31: jaxtyping v0.2.31

Compare Source

  • 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 just some_method.

  • Fixed a JAX deprecation warning for jax.tree_map. (Thanks @​groszewn!)

New Contributors

Full Changelog: patrick-kidger/jaxtyping@v0.2.30...v0.2.31

v0.2.30: jaxtyping v0.2.30

Compare Source

  • 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

Full Changelog: patrick-kidger/jaxtyping@v0.2.29...v0.2.30

v0.2.29: jaxtyping v0.2.29

Compare Source

  • Crash fix for when jax is available but jaxlib 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

Full Changelog: patrick-kidger/jaxtyping@v0.2.28...v0.2.29


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/jaxtyping-0.x-lockfile branch from 27438ec to c7f2198 Compare June 13, 2024 17:37
@renovate renovate bot changed the title Update dependency jaxtyping to v0.2.29 Update dependency jaxtyping to v0.2.30 Jun 13, 2024
@renovate renovate bot force-pushed the renovate/jaxtyping-0.x-lockfile branch from c7f2198 to 300ac18 Compare June 25, 2024 19:29
@renovate renovate bot changed the title Update dependency jaxtyping to v0.2.30 Update dependency jaxtyping to v0.2.31 Jun 25, 2024
@renovate renovate bot force-pushed the renovate/jaxtyping-0.x-lockfile branch from 300ac18 to 3b33930 Compare July 12, 2024 11:34
@renovate renovate bot changed the title Update dependency jaxtyping to v0.2.31 Update dependency jaxtyping to v0.2.32 Jul 12, 2024
@renovate renovate bot force-pushed the renovate/jaxtyping-0.x-lockfile branch from 3b33930 to e1239ef Compare July 12, 2024 13:44
@renovate renovate bot changed the title Update dependency jaxtyping to v0.2.32 Update dependency jaxtyping to v0.2.33 Jul 12, 2024
@renovate renovate bot force-pushed the renovate/jaxtyping-0.x-lockfile branch from e1239ef to 4eb703d Compare July 18, 2024 01:26
@JasonGross JasonGross merged commit d014df2 into main Jul 18, 2024
13 checks passed
@JasonGross JasonGross deleted the renovate/jaxtyping-0.x-lockfile branch July 18, 2024 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant