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:
- Environment variables (highest priority),
micromechanical.(toml|yaml|yml|json),micromechanical/config.(toml|yaml|yml|json),[tool.micromechanical]inpyproject.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 |
cache_model_runs |
bool |
true |
Cache simulation results. | MICROMECHANICAL_CACHE_MODEL_RUNS |
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 |
numbering_title_fontsize |
string,float |
None |
Font size for numbering title. | MICROMECHANICAL_NUMBERING_TITLE_FONTSIZE |
Note
Underscores in the option names can be replaced with dashes in configuration files.