From e05985df2b37e7849f8a02f8b493759a161c5967 Mon Sep 17 00:00:00 2001 From: Patrick Kidger <33688385+patrick-kidger@users.noreply.github.com> Date: Wed, 20 Sep 2023 11:12:10 -0700 Subject: [PATCH] Document IPython extension and version nump --- docs/api/runtime-type-checking.md | 12 ++++++++++++ pyproject.toml | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/api/runtime-type-checking.md b/docs/api/runtime-type-checking.md index 36719fb..772ec29 100644 --- a/docs/api/runtime-type-checking.md +++ b/docs/api/runtime-type-checking.md @@ -20,3 +20,15 @@ It can be a lot of effort to add `@jaxtyped` decorators all over your codebase. The easier option is usually to use the import hook. ::: jaxtyping.install_import_hook + +--- + +#### IPython extension + +If you are running in an IPython environment (for example a Jupyter or Colab notebook), then the jaxtyping hook can be automatically ran via a custom magic: +```python +import jaxtyping +%load_ext jaxtyping +%jaxtyping.typechecker beartype.beartype # or any other runtime type checker +``` +Place this at the start of your notebook -- everything that is directly defined in the notebook, after this magic is run, will be hook'd. diff --git a/pyproject.toml b/pyproject.toml index 66a316b..b6def35 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "jaxtyping" -version = "0.2.21" +version = "0.2.22" description = "Type annotations and runtime checking for shape and dtype of JAX arrays, and PyTrees." readme = "README.md" requires-python ="~=3.9"