Skip to content

Latest commit

 

History

History
59 lines (40 loc) · 2.28 KB

configuring.rst

File metadata and controls

59 lines (40 loc) · 2.28 KB

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 :external:py:mod:`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 :external:py:meth:`logging.getLogger("imas").setLevel(...) <logging.Logger.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 :ref:`The default Data Dictionary version` to use.

Environment variables shared with the IMAS Python HLI

IMAS_AL_DISABLE_VALIDATE

By default, IMAS-Python :ref:`validates <IDS validation>` IDSs to check that all data is consistent with their coordinates during a :py:meth:`~imas.db_entry.DBEntry.put` or :py:meth:`~imas.db_entry.DBEntry.put_slice`.

Setting IMAS_AL_DISABLE_VALIDATE=1 disables this validation.

IMAS_AL_SERIALIZER_TMP_DIR

Specify the path to storing temporary data during :py:meth:`~imas.ids_toplevel.IDSToplevel.serialize` and :py:meth:`~imas.ids_toplevel.IDSToplevel.deserialize`.

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