Sanity checks for bags.
This commit is contained in:
@@ -8,6 +8,8 @@ class BagDescription(object):
|
||||
self.right_operand = R_oper
|
||||
self.entity = entity
|
||||
|
||||
self.sanity_check()
|
||||
|
||||
def __repr__(self):
|
||||
if self.f_type == BagDesc_oper.entity:
|
||||
return self.entity
|
||||
@@ -31,11 +33,12 @@ class BagDescription(object):
|
||||
return repr(self.left_operand) + " > " + repr(self.right_operand)
|
||||
|
||||
def sanity_check(self):
|
||||
"""Checks if the right operands for the relations are integers"""
|
||||
"""Sanity checks"""
|
||||
|
||||
# TODO
|
||||
|
||||
pass
|
||||
for operand in (self.left_operand, self.right_operand):
|
||||
if operand:
|
||||
if not (isinstance(operand, BagDescription) or isinstance(operand, int)):
|
||||
raise RuntimeError("Unexpected operand type for a bag: " + str(operand))
|
||||
|
||||
@classmethod
|
||||
def f_entity(cls, entity_name):
|
||||
|
||||
Reference in New Issue
Block a user