From faf62d9ef7a7680a992b197dc24c55a30446809c Mon Sep 17 00:00:00 2001 From: Filippo Luca Ferretti Date: Wed, 18 Dec 2024 11:05:37 +0100 Subject: [PATCH] Add environment variable to disable runtime exceptions --- src/jaxsim/exceptions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/jaxsim/exceptions.py b/src/jaxsim/exceptions.py index 58e3fc1a0..5b10f696b 100644 --- a/src/jaxsim/exceptions.py +++ b/src/jaxsim/exceptions.py @@ -1,3 +1,5 @@ +import os + import jax @@ -18,7 +20,9 @@ def raise_if( """ # Disable host callback if running on TPU. - if jax.devices()[0].platform == "tpu": + if jax.devices()[0].platform == "tpu" or os.environ.get( + "JAXSIM_DISABLE_EXCEPTIONS", 0 + ): return # Check early that the format string is well-formed.