janushendersonassetallocation / loman

Loman is a Python library designed to allow quantitative researchers to control complex live updating calculation processes
BSD 3-Clause "New" or "Revised" License
95 stars 13 forks source link

Add support for node tags #8

Closed edparcell closed 7 years ago

edparcell commented 7 years ago

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.

edparcell commented 7 years ago

Node tags are added by 3b88252b6db4c43ee60d41fcf7ea79c41a868b9d. 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.

edparcell commented 7 years ago

Added nodes_by_tag method in 2f30c0ba155570436c0cff089ff28266f8845234.