Checks#
Metatensor performs shape as well as consistency checks for the metadata during each
operation. The check status can be verified with metatensor.checks_enabled()
and controlled by metatensor.unsafe_enable_checks()
and
metatensor.unsafe_disable_checks()
.
Warning
Using metatensor without checks is unsafe, can lead to unwanted results, and may produce cryptic error messages. Therefore, disabling checks is not recommended and should only be used by advanced users! If you see strange results after disabling checks, try running the code again with checks enabled.
Checks can either be disabled temporarily via a compound statements or globally and permanently by calling the speicific function directly.
The checks can also controlled wit the environment variable
METATENSOR_UNSAFE_DISABLE_CHECKS
. To disable checks set
export METATENSOR_UNSAFE_DISABLE_CHECKS=1
Note that metatensor.unsafe_enable_checks()
or
metatensor.unsafe_disable_checks()
overwrite the defintion of the enviroment
variable.