Skip to content

Commit

Permalink
Merge pull request #29 from jrmyp/ilp
Browse files Browse the repository at this point in the history
ENH Parser.select function (twin of deselect)
  • Loading branch information
kowey committed May 19, 2015
2 parents 96468d6 + d32cb9c commit cebbff5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions attelo/parser/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ def multiply(dpack, attach=None, label=None):
label=label)
return dpack.set_graph(graph)

@staticmethod
def select(dpack, idxes):
""" Mark any pairs except the ones indicated as unrelated
See Also
--------
`Parser.deselect`"""
unwanted_idxes = np.ones_like(dpack.graph.attach, dtype=bool)
unwanted_idxes[idxes] = False
return Parser.deselect(dpack, unwanted_idxes)

@staticmethod
def deselect(dpack, idxes):
"""
Expand Down

0 comments on commit cebbff5

Please sign in to comment.