Skip to content

Commit 33097bd

Browse files
committed
removed Hyperedge.has_argroles
1 parent 548b06d commit 33097bd

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
### Removed
2424
- function patterns.edge_matches_pattern.
25-
- deprecated and obsolete methods from Hyperedge: is_atom, to_str, roots, insert_first_argument, connect, sequence, contains_atom_type, main_concepts, replace_main_concept.
25+
- deprecated and obsolete methods from Hyperedge: is_atom, to_str, roots, insert_first_argument, connect, sequence, contains_atom_type, main_concepts, replace_main_concept, has_argroles.
2626

2727
## [0.8.0] - 26-03-2026 - hyperbase is the successor of graphbrain
2828

src/hyperbase/hyperedge.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -535,10 +535,6 @@ def argroles(self) -> str:
535535
return ""
536536
return self[1].argroles() # type: ignore[no-any-return]
537537

538-
def has_argroles(self) -> bool:
539-
"""Returns True if the edge has argroles, False otherwise."""
540-
return self.argroles() != ""
541-
542538
def replace_argroles(self, argroles: str | None) -> Hyperedge:
543539
"""Returns an edge with the argroles of the connector atom replaced
544540
with the provided string.

src/hyperbase/patterns/common.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,17 @@ def _common_pattern(edge1: Hyperedge, edge2: Hyperedge) -> Hyperedge | None:
136136
if (
137137
nedge1.not_atom
138138
and nedge2.not_atom
139-
and nedge1.has_argroles()
140-
and nedge2.has_argroles()
139+
and nedge1.argroles()
140+
and nedge2.argroles()
141141
) and nedge1.mt == nedge2.mt:
142142
common = common_pattern_argroles(nedge1, nedge2)
143143
if common:
144144
return common
145145

146146
# do not combine edges with argroles and edges without them
147147
perform_ordered_match = not (
148-
(nedge1.not_atom and nedge1.has_argroles())
149-
or (nedge2.not_atom and nedge2.has_argroles())
148+
(nedge1.not_atom and nedge1.argroles())
149+
or (nedge2.not_atom and nedge2.argroles())
150150
)
151151
# same length
152152
if (

0 commit comments

Comments
 (0)