Exemple #1
0
 def _unify_type(self, t):
     if self._ret_type is None:
         self._ret_type = t
     else:
         r = unify_types_limited(self._ret_type, t)
         if not r:
             raise TypeError(
                 "'then' expressions must have same type, found '{}' and '{}'"
                 .format(self._ret_type, t))
Exemple #2
0
 def _unify_type(self, t):
     if self._ret_type is None:
         self._ret_type = t
     else:
         r = unify_types_limited(self._ret_type, t)
         if not r:
             raise TypeError("'then' expressions must have same type, found '{}' and '{}'".format(
                 self._ret_type, t
             ))
Exemple #3
0
    def __init__(self, start, end, includes_start=True, includes_end=False, point_type=None):
        if point_type is None:
            from hail.expr.expressions import impute_type, unify_types_limited
            start_type = impute_type(start)
            end_type = impute_type(end)
            point_type = unify_types_limited(start_type, end_type)
            if point_type is None:
                raise TypeError("'start' and 'end' have incompatible types: '{}', '{}'.".format(start_type, end_type))

        self._point_type = point_type
        self._start = start
        self._end = end
        self._includes_start = includes_start
        self._includes_end = includes_end
Exemple #4
0
    def __init__(self, start, end, includes_start=True, includes_end=False):
        from hail.expr.expressions import impute_type, unify_types_limited
        start_type = impute_type(start)
        end_type = impute_type(end)
        point_type = unify_types_limited(start_type, end_type)

        if point_type is None:
            raise TypeError("'start' and 'end' have incompatible types: '{}', '{}'.".format(start_type, end_type))

        self._point_type = point_type
        self._start = start
        self._end = end
        self._includes_start = includes_start
        self._includes_end = includes_end

        self._jrep = scala_object(Env.hail().utils, 'Interval').apply(
            point_type._convert_to_j(start),
            point_type._convert_to_j(end),
            includes_start,
            includes_end)
Exemple #5
0
    def __init__(self, start, end, includes_start=True, includes_end=False):
        from hail.expr.expressions import impute_type, unify_types_limited
        start_type = impute_type(start)
        end_type = impute_type(end)
        point_type = unify_types_limited(start_type, end_type)

        if point_type is None:
            raise TypeError("'start' and 'end' have incompatible types: '{}', '{}'.".format(start_type, end_type))

        self._point_type = point_type
        self._start = start
        self._end = end
        self._includes_start = includes_start
        self._includes_end = includes_end

        self._jrep = scala_object(Env.hail().utils, 'Interval').apply(
            point_type._convert_to_j(start),
            point_type._convert_to_j(end),
            includes_start,
            includes_end)
Exemple #6
0
    def __init__(self,
                 start,
                 end,
                 includes_start=True,
                 includes_end=False,
                 point_type=None):
        if point_type is None:
            from hail.expr.expressions import impute_type, unify_types_limited
            start_type = impute_type(start)
            end_type = impute_type(end)
            point_type = unify_types_limited(start_type, end_type)
            if point_type is None:
                raise TypeError(
                    "'start' and 'end' have incompatible types: '{}', '{}'.".
                    format(start_type, end_type))

        self._point_type = point_type
        self._start = start
        self._end = end
        self._includes_start = includes_start
        self._includes_end = includes_end