Skip to content

Commit

Permalink
BooleanNetwork.__call__: use __call__ methods of boolean.py
Browse files Browse the repository at this point in the history
  • Loading branch information
pauleve committed Apr 27, 2023
1 parent 4e39b38 commit 8cc64c4
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions colomoto/minibn.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,10 @@ def _normalize_tr(self, tr):
return ntr

def __call__(self, cfg):
tr = self._normalize_tr(cfg)
def _autostate(expr):
if expr == self.ba.TRUE:
return 1
elif expr == self.ba.FALSE:
return 0
return expr
return {a: _autostate(self[a].subs(tr).simplify()) for a in self}
return {a: int(self[a](**cfg)) for a in self}

def zero(self):
return {a:0 for a in self}
return {a: 0 for a in self}

def rewrite(self, a, tr, simplify=True):
tr = self._normalize_tr(tr)
Expand Down

0 comments on commit 8cc64c4

Please # to comment.