aiida_vasp.workchains.v2.common.dictwrap#
Wrapper class to simply updating an Node when configuring inputs of a calculation.
This module is currently not used in the code, but kept here for future reference. It is not clear such wrapper for Dict would truly benefit the usability of the code.
Module Contents#
Classes#
Wrapper class for a dict |
API#
- class aiida_vasp.workchains.v2.common.dictwrap.DictWrapper(node, namespace=None, port=None)[source]#
Bases:
collections.UserDictWrapper class for a dict
Wraps around an Dict node, saved or not, to allow python dict-like in place modifications.
Initialization
Wrapper around a
Dictnode. Optionally also include a namespace and a port that the underlying Node should be assigned to. The wrappedDictnode is never update in practice and only used as an initial reference data. If there is no change, the same Dict node will be passed as it is under thenodeproperty.- Parameters:
node – The node to be wrapped.
namespace – The namespace that the node should be assigned to.
port – The port under the namespace.
A new node is created whenever necessary.
- property is_updated#
- property node#
Returns a node object that represents the stored data.
This can be a stored node (if no update) or an unstore node
- _ensure_unstored()[source]#
Ensure that self._unstored_node is indeed unstored If it is not the case - we move it to self._stored_node an create a new unstored node.