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

Decorator to add nodes #11

Closed edparcell closed 7 years ago

edparcell commented 7 years ago

It'd be neat if there was a decorator, so you could do this:

@loman.node(comp)
def b(a):
  return a+1

and it's equivalent to

comp.add_node('b', lambda a: a+1)
edparcell commented 7 years ago

Initial version added in 8c66bbe49f027409a56ca0c3797cfd4d8ca400f0.