Provides access to Iris-specific configuration values.

The default configuration values can be overridden by creating the file iris/etc/site.cfg. If it exists, this file must conform to the format defined by ConfigParser.


Local directory where sample data exists. Defaults to “sample_data” sub-directory of the Iris package install directory. The sample data directory supports the Iris gallery. Directory contents accessed via iris.sample_data_path().

Deprecated since version 1.10.


Local directory where test data exists. Defaults to “test_data” sub-directory of the Iris package install directory. The test data directory supports the subset of Iris unit tests that require data. Directory contents accessed via iris.tests.get_data_path().


The full path to the Iris palette configuration directory


The [optional] name of the logger to notify when first imported.


The [optional] full path to the rule logging directory used by iris.fileformats.pp.load() and

Deprecated since version 1.10.


The [optional] list of users to ignore when logging rules.

Deprecated since version 1.10.

In this module:


Control Iris NetCDF options.

↑ top ↑

iris.config.get_dir_option(section, option, default=None)

Returns the directory path from the given option and section, or returns the given default value if the section/option is not present or does not represent a valid directory.

↑ top ↑

iris.config.get_option(section, option, default=None)

Returns the option value for the given section, or the default value if the section/option is not present.

↑ top ↑

Control Iris NetCDF options.

class iris.config.NetCDF(conventions_override=None)

Bases: object

Set up NetCDF processing options for Iris.

Currently accepted kwargs:

  • conventions_override (bool):

    Define whether the CF Conventions version (e.g. CF-1.6) set when saving a cube to a NetCDF file should be defined by Iris (the default) or the cube being saved.

    If False (the default), specifies that Iris should set the CF Conventions version when saving cubes as NetCDF files. If True, specifies that the cubes being saved to NetCDF should set the CF Conventions version for the saved NetCDF files.

Example usages:

  • Specify, for the lifetime of the session, that we want all cubes written to NetCDF to define their own CF Conventions versions:

    iris.config.netcdf.conventions_override = True'my_cube', '')'my_second_cube', '')
  • Specify, with a context manager, that we want a cube written to NetCDF to define its own CF Conventions version:

    with iris.config.netcdf.context(conventions_override=True):'my_cube', '')
context(*args, **kwds)

Allow temporary modification of the options via a context manager. Accepted kwargs are the same as can be supplied to the Option.