Exemplo n.º 1
0
 def wrap_input(interval):
     if interval is None:
         raise TypeError("'filter_intervals' does not allow missing values in 'intervals'.")
     elif needs_wrapper:
         return Interval(Struct(**{k_name: interval.start}),
                         Struct(**{k_name: interval.end}),
                         interval.includes_start,
                         interval.includes_end)
     else:
         return interval
Exemplo n.º 2
0
 def _convert_to_py(self, annotation):
     if annotation is not None:
         d = dict()
         for i, (f, t) in enumerate(self.items()):
             d[f] = t._convert_to_py(annotation.get(i))
         return Struct(**d)
     else:
         return None
Exemplo n.º 3
0
Arquivo: types.py Projeto: dujm/hail
 def _convert_to_py(self, annotation):
     if annotation is not None:
         d = dict()
         for i, f in enumerate(self.fields):
             d[f.name] = f.typ._convert_to_py(annotation.get(i))
         return Struct(**d)
     else:
         return None
Exemplo n.º 4
0
 def _convert_from_json(self, x):
     from hail.utils import Struct
     return Struct(**{f: t._convert_from_json_na(x.get(f)) for f, t in self.items()})
Exemplo n.º 5
0
 def _convert_from_json(self, x):
     return Struct(
         **{f: t._convert_from_json_na(x.get(f))
            for f, t in self.items()})