- class metallurgy.alloy.Alloy.Composition(metallurgy.alloy.OrderedDict)[source]
Atomic percentages of elements in an alloy.
Public members¶
- Composition(value: dict, on_change: Callable, *args, **kwargs)[source]
Initialize self. See help(type(self)) for accurate signature.
-
__setitem__(element: str, percentage: float, respond_to_change=
True)[source] Set the percentage value of an element in the composition. Remove elements from the composition if below minimum threshold.
-
__delitem__(element, respond_to_change=
True)[source] Delete self[key].
-
fromkeys(value=
None)[source] Create a new ordered dictionary with keys from iterable and values set to value.
- __reduce__()[source]
Return state information for pickling
-
setdefault(key, default=
None)[source] Insert key with a value of default if key is not in the dictionary.
- pop(...) v, remove specified key and return the corresponding value.[source]
If the key is not found, return the default if given; otherwise, raise a KeyError.
- update([E, ]**F) None. Update D from dict/iterable E and F.[source]
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
-
move_to_end(key, last=
True)[source] Move an existing element to the end (or beginning if last is false).
Last update:
Jun 08, 2023