Configuring IMAS-Python

IMAS-Python has a couple of environment variables that can be used to control its behaviour. This page provides an overview of available variables.

Note

In addition to the listed environment variables, the IMAS Core library also has environment variables available to control its behaviour. See the IMAS Core documentation

IMAS_LOGLEVEL

Sets the log level used by the IMAS-Python logger.

By default (when this environment variable is not set), all log messages of INFO or more severe are logged. You may set this to, for example, IMAS_LOGLEVEL=WARNING, to suppress some of the log messages.

See the Python documentation for the logging module which log levels are available.

Note

This environment variable is read when the imas library is initialized during the first import imas. Changing it afterwards has no effect, but you can use logging.getLogger("imas").setLevel(...) to change the log level programmatically.

IMAS_DISABLE_NC_VALIDATE

Disables validation of netCDF files when loading an IDS from an IMAS netCDF file.

Caution

Disabling the validation may lead to errors when reading data from an IMAS netCDF file.

IMAS_VERSION

Sets The default Data Dictionary version to use.

Environment variables shared with the IMAS Python HLI

IMAS_AL_DISABLE_VALIDATE

By default, IMAS-Python validates IDSs to check that all data is consistent with their coordinates during a put() or put_slice().

Setting IMAS_AL_DISABLE_VALIDATE=1 disables this validation.

IMAS_AL_SERIALIZER_TMP_DIR

Specify the path to storing temporary data during serialize() and deserialize().

If it is not set, the default location /dev/shm/ or the current working directory will be chosen.


Last update: 2026-01-28