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_LOGLEVELSets the log level used by the IMAS-Python logger.
By default (when this environment variable is not set), all log messages of
INFOor 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
loggingmodule which log levels are available.Note
This environment variable is read when the
imaslibrary is initialized during the firstimport imas. Changing it afterwards has no effect, but you can uselogging.getLogger("imas").setLevel(...)to change the log level programmatically.IMAS_DISABLE_NC_VALIDATEDisables 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_VERSIONSets The default Data Dictionary version to use.
Environment variables shared with the IMAS Python HLI¶
IMAS_AL_DISABLE_VALIDATEBy default, IMAS-Python validates IDSs to check that all data is consistent with their coordinates during a
put()orput_slice().Setting
IMAS_AL_DISABLE_VALIDATE=1disables this validation.IMAS_AL_SERIALIZER_TMP_DIRSpecify the path to storing temporary data during
serialize()anddeserialize().If it is not set, the default location
/dev/shm/or the current working directory will be chosen.