zospy.analyses.base.AttrDict#
- class zospy.analyses.base.AttrDict#
Bases:
dict
Basically a dict with attribute access.
Equal to scipy’s OptimizeResult (scipy/scipy).
Methods
from_dict
(dictionary[, convert_nested, method])Create an AttrDict from a standard dict.
to_dict
([convert_nested, method])Convert the AttrDict to a standard dict.
- classmethod from_dict(dictionary, convert_nested=True, method='deepcopy')#
Create an AttrDict from a standard dict.
- Parameters:
- dictionary: dict
The dictionary that is to be converted
- convert_nested: bool
Whether nested dictionaries should be converted as well. Defaults to True
- method: str
The method used to copy values. One of ‘deepcopy’, ‘copy’ and ‘assign’. Defaults to ‘deepcopy’
- Returns:
- AttrDict
The converted AttrDict
- to_dict(convert_nested=True, method='deepcopy')#
Convert the AttrDict to a standard dict.
- Parameters:
- convert_nested: bool
Whether nested dictionaries should be converted as well. Defaults to True
- method: str
The method used to copy values. One of ‘deepcopy’, ‘copy’ and ‘assign’. Defaults to ‘deepcopy’
- Returns:
- dict
The AttrDict as standard Dict