diprism / fggs

Factor Graph Grammars in Python
MIT License
13 stars 3 forks source link

Labeling mixin #139

Closed davidweichiang closed 2 years ago

davidweichiang commented 2 years ago

I didn't like how much duplicated code (though not duplicated entirely consistently) there was between Graph and HRG for handling node and edge labels. This factors all that code into a single class LabelingMixin.

Alternative: Make both Graph and HRG contain a Labeling object. This is probably more orthodox but adds more complexity to code that uses Graphs and HRGs.

davidweichiang commented 2 years ago

Also, this adds some missing type annotations in Graph and that required a bunch of other changes to be made in order to get it to type.