Skip to content

Configurations

The package can be configured in the [tool.micromechanical] table of the pyproject.toml file, the micromechanical.toml file, the micromechanical/config.toml file, or using environment variables.

The priority of the configurations is as follows:

  1. Environment variables (highest priority),
  2. micromechanical.(toml|yaml|yml|json),
  3. micromechanical/config.(toml|yaml|yml|json),
  4. [tool.micromechanical] in pyproject.toml (lowest priority).

Multiple configuration files can be used at the same time, and the configurations are merged in the order listed above.

The following options can be used to configure the package in the configuration files, environment variable names are in uppercase, prefixed with MICROMECHANICAL_.

name type default description Environment Variable
backend string cpp Default backend. MICROMECHANICAL_BACKEND
plotting_backend string matplotlib Default plotting backend. MICROMECHANICAL_PLOTTING_BACKEND
matplotlib_styles list[str] ['science', 'grid'] Matplotlib styles to use. MICROMECHANICAL_MATPLOTLIB_STYLES
precision string double Float precision. MICROMECHANICAL_PRECISION
numba_enabled bool true Whether to enable numba. NUMBA_DISABLE_JIT
suppress_warnings bool true Whether to Suppresses warnings. MICROMECHANICAL_SUPPRESS_WARNINGS
suppress_output bool false Whether to suppresses output. MICROMECHANICAL_SUPPRESS_OUTPUT
cache_contact bool true Cache contact state variables. MICROMECHANICAL_CACHE_CONTACT
dataset_dirs list[str] [] Custom dataset directories. MICROMECHANICAL_DATASET_DIRS
language string en Default language. MICROMECHANICAL_LANGUAGE
translation_file string micromechanical-translations.yaml Default translation file. MICROMECHANICAL_TRANSLATION_FILE