Skip to content

Commit

Permalink
import
Browse files Browse the repository at this point in the history
  • Loading branch information
Wout4 committed Sep 21, 2023
1 parent 9b5172a commit 064b202
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cpmpy/transformations/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import numpy as np
import builtins

from cpmpy.transformations.flatten_model import __is_flat_var

from ..expressions.core import BoolVal, Expression, Comparison, Operator
from ..expressions.utils import eval_comparison, is_false_cst, is_true_cst, is_boolexpr, is_num
from ..expressions.variables import NDVarArray
Expand Down Expand Up @@ -252,4 +250,10 @@ def normalize_boolexpr(lst_of_expr):
continue

newlist.append(expr)
return newlist
return newlist


def __is_flat_var(arg):
""" True if the variable is a numeric constant, or a _NumVarImpl (incl subclasses)
"""
return is_num(arg) or isinstance(arg, _NumVarImpl)

0 comments on commit 064b202

Please sign in to comment.