janushendersonassetallocation/loman

Add support for node tags

Closed this issue · 2 comments

Nodes will have an attribute "tags" which will be a set (usually of strings). This will allow addressing nodes by tags. For example compute could take one or more tags as a parameter, rather than a list of nodes.
add_node should take an optional parameter "tags".
Additional methods add_tags and remove_tags to set or unset one or more tags on one or more nodes. These methods should not raise exceptions if a tag is re-added, or a tag that is not present is removed.

Node tags are added by 3b88252. remove_tags was renamed to clear_tags, and singular versions are also provided.

An additional method get_nodes_by_tags is required to get a list of nodes with a specific tag or tags, so I am leaving this issue open.

Added nodes_by_tag method in 2f30c0b.