Skip to content

Latest commit

 

History

History
59 lines (40 loc) · 2.34 KB

configuring.rst

File metadata and controls

59 lines (40 loc) · 2.34 KB

Configuring IMASPy

IMASPy 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 Access Layer lowlevel also has environment variables available to control its behaviour. See the Access Layer documentation

IMASPY_LOGLEVEL

Sets the log level used by the IMASPy 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, IMASPY_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 imaspy library is initialized during the first import imaspy. Changing it afterwards has no effect, but you can use :external:py:meth:`logging.getLogger("imaspy").setLevel(...) <logging.Logger.setLevel>` to change the log level programmatically.

IMASPY_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, IMASPy :ref:`validates <IDS validation>` IDSs to check that all data is consistent with their coordinates during a :py:meth:`~imaspy.db_entry.DBEntry.put` or :py:meth:`~imaspy.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:`~imaspy.ids_toplevel.IDSToplevel.serialize` and :py:meth:`~imaspy.ids_toplevel.IDSToplevel.deserialize`.

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