{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Runtime Configuration\n", "\n", "The `scipp` Python module supports several configuration options which may be set based on preference.\n", "Most of these are related to layout of items in Jupyter Notebooks and plotting.\n", "\n", "The location of the configuration file varies between operating systems.\n", "To determine where it is located on a particular installation the following Python may be used:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import scipp as sc\n", "print(sc.user_configuration_filename)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "When the `scipp` module is imported and no configuration file exists a default one is created.\n", "If a configuration file already exists it will not be modified, i.e. new options will not automatically be added to it when Scipp is updated.\n", "\n", "Values may be set via Python as follows:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "print('Old value:', sc.config.plot.width)\n", "sc.config.update({'plot.width': 300})\n", "print('New value:', sc.config.plot.width)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note that changes made via the Python API are not persisted in the configuration file.\n", "Permanent changes must be made to the file directly." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "