tetherless-world / mowgli-etl

DARPA Machine Common Sense (MCS) Multi-modal Open World Grounded Learning and Inference (MOWGLI) Extract-Transform-Load sub-project
MIT License
6 stars 1 forks source link

ETL: implement visitor pattern instead of checking instanceof Node or Edge everywhere #116

Closed gordom6 closed 4 years ago

gordom6 commented 4 years ago

def transform_visitor(transform_generator, callback) callback is def callback(*, node: Optional[Node] = None, edge: Optional[Edge] = None, **kwds) Then this wrapper does the isinstance checks and makes the right call. Use a function and not an object visitor so it can do closures.