abtem.core.config#
Module Contents#
Classes#
Temporarily set configuration values within a context manager |
Functions#
Check if the provided value has been renamed or removed |
|
Get elements from global config |
|
Update configuration by re-reading yaml files and env variables |
|
Add a new set of defaults to the configuration |
Data#
API#
- abtem.core.config.check_deprecations(...) str[source]#
Check if the provided value has been renamed or removed
- abtem.core.config.config_lock#
‘Lock(…)’
- abtem.core.config.get(...) Any[source]#
Get elements from global config
If
override_withis not None this value will be passed straight back. Useful for getting kwarg defaults from abtek config.Use ‘.’ for nested access
- abtem.core.config.no_default#
‘no_default’
- abtem.core.config.refresh(...) None[source]#
Update configuration by re-reading yaml files and env variables
This mutates the global abtem.config.config, or the config parameter if passed in.
This goes through the following stages:
Clearing out all old configuration
Updating from the stored defaults from downstream libraries (see update_defaults)
Updating from yaml files and environment variables
Note that some functionality only checks configuration once at startup and may not change behavior, even if configuration changes. It is recommended to restart your python process if convenient to ensure that new configuration changes take place.
See also
abtem.config.collectfor parameters
abtem.config.update_defaults
- class abtem.core.config.set(...)[source]#
Temporarily set configuration values within a context manager
- Parameters:
arg (mapping or None, optional) – A mapping of configuration key-value pairs to set.
**kwargs – Additional key-value pairs to set. If
argis provided, values set inargwill be applied before those inkwargs. Double-underscores (__) in keyword arguments will be replaced with., allowing nested values to be easily set.
Initialization