Exemplo n.º 1
0
 def __call__(self, *args):
     try:
         # try to do it from the superclass
         return LOTHypothesis.__call__(self, *args)
     except ZeroDivisionError:
         # and if we get an error, return nan
         return float("nan")
Exemplo n.º 2
0
 def __call__(self, *vals):
     """
         Must overwrite call in order to include the constants
     """
     vals = list(vals)
     vals.extend(self.parameters)
     return LOTHypothesis.__call__(self, *vals)
Exemplo n.º 3
0
 def __call__(self, *vals):
     """
         Must overwrite call in order to include the constants
     """
     vals = list(vals)
     vals.extend(self.parameters)
     return LOTHypothesis.__call__(self, *vals)
Exemplo n.º 4
0
 def __call__(self, *vals):
     """
         Must overwrite call in order to include the constants
     """
     vals = list(vals)
     vals.extend(self.CONSTANT_VALUES)
     return LOTHypothesis.__call__(self, *vals)
Exemplo n.º 5
0
    def __call__(self, *args, **kwargs):
        # we have to mod this to insert the spaces since they aren't part of cons above
        ret = LOTHypothesis.__call__(self, *args, **kwargs)

        out = dict()
        for k, v in ret.items():
            out[" ".join(k)] = v
        return out
Exemplo n.º 6
0
    def __call__(self, *args, **kwargs):
        # we have to mod this to insert the spaces since they aren't part of cons above
        ret = LOTHypothesis.__call__(self, *args, **kwargs)

        out = dict()
        for k, v in ret.items():
            out[' '.join(k)] = v
        return out
Exemplo n.º 7
0
    def __call__(self, *args, **kwargs):
        d = LOTHypothesis.__call__(self, *args, **kwargs) # now returns a dictionary

        # go through and reformat the keys to have spaces
        #NOTE: requires that terminals are each single chars, see assertion above
        out = dict()
        for k, v in d.items():
            out[' '.join(k)] = v
        return out
Exemplo n.º 8
0
    def __call__(self, *args, **kwargs):
        if self.value_set is None:
            value_set = LOTHypothesis.__call__(self)
            # Restrict our concept to being within our domain; also handle 'None' call values
            if isinstance(value_set, set):
                value_set = [x for x in value_set if x <= self.domain]
            else:
                value_set = []
            self.value_set = value_set

        return self.value_set
Exemplo n.º 9
0
    def __call__(self, *args, **kwargs):
        # Sometimes self.value has too many nodes
        try:
            value_set = LOTHypothesis.__call__(self)
        except TooBigException:
            value_set = set()

        if isinstance(value_set, set):
            # Restrict our concept to being within our domain
            value_set = [x for x in value_set if (1 <= x <= self.domain)]
        else:
            # Sometimes self() returns None
            value_set = set()

        return value_set
Exemplo n.º 10
0
 def __call__(self):
     out = LOTHypothesis.__call__(self)
     #if len(out) != MAX:
     #want to be able to generalize to N-lengthed sequences
     #sout = ""
     return out
Exemplo n.º 11
0
 def __call__(self, *args):
     out = LOTHypothesis.__call__(self, *args)
     return out
Exemplo n.º 12
0
 def __call__(self, *args):
     try:
         return LOTHypothesis.__call__(self, *args)
     except EvaluationException:
         return None
Exemplo n.º 13
0
 def __call__(self, *args, **kwargs):
     return compute_outcomes(lambda *args: LOTHypothesis.__call__(self, *args, **kwargs), maxcontext=100000)
Exemplo n.º 14
0
 def __call__(self, *args):
     try:
         return LOTHypothesis.__call__(self, *args)
     except EvaluationException:
         return None