Skip to content

Commit

Permalink
Is bool boolval (#456)
Browse files Browse the repository at this point in the history
* add BoolVal to check

* delete unnecessary linebreaks

* remove unused import
  • Loading branch information
Wout4 authored Mar 4, 2024
1 parent f038263 commit f7e5cbb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cpmpy/expressions/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@

import numpy as np
import math
from collections.abc import Iterable # for _flatten
from itertools import chain, combinations
from collections.abc import Iterable # for flatten
from itertools import combinations
from cpmpy.exceptions import IncompleteFunctionError


def is_bool(arg):
""" is it a boolean (incl numpy variants)
"""
return isinstance(arg, (bool, np.bool_))
from cpmpy import BoolVal
return isinstance(arg, (bool, np.bool_, BoolVal))


def is_int(arg):
Expand Down

0 comments on commit f7e5cbb

Please sign in to comment.