aplbrain / aplbrain/grand-cypher

is_edge_attr_match fails on attribs other than labels

オープン
#85 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
129
フォーク
17
PR マージ指標
PR 指標を取得中

説明

the function _is_edge_attr_match doesn't work on any other attributes other than __labels__

This is due two the _aggregate_edge_labels

```python
motif_edges = _aggregate_edge_labels(motif_edges)
host_edges = _aggregate_edge_labels(host_edges)
```

After the calls, motif_edges and host_edges only have __labels__ attributes left, and other attribuets are dropped.

```python
def _aggregate_edge_labels(edges: Dict) -> Dict:
"""
Aggregate '__labels__' attributes from edges into a single set.
"""
aggregated = {"__labels__": set()}
for edge_id, attrs in edges.items():
if "__labels__" in attrs and attrs["__labels__"]:
aggregated["__labels__"].update(attrs["__labels__"])
elif "__labels__" not in attrs:
aggregated[edge_id] = attrs
return aggregated
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。