示例#1
0
文件: table_ir.py 项目: pblh123/hail
 def _compute_type(self):
     name = self.config['name']
     child_typ = self.child.typ
     pass_through = self.config['passThrough']
     if name == 'LinearRegressionRowsChained':
         chained_schema = hl.dtype(
             'struct{n:array<int32>,sum_x:array<float64>,y_transpose_x:array<array<float64>>,beta:array<array<float64>>,standard_error:array<array<float64>>,t_stat:array<array<float64>>,p_value:array<array<float64>>}'
         )
         self._type = hl.ttable(
             child_typ.global_type, (child_typ.row_key_type._insert_fields(
                 **{f: child_typ.row_type[f]
                    for f in pass_through})._concat(chained_schema)),
             child_typ.row_key)
     elif name == 'LinearRegressionRowsSingle':
         chained_schema = hl.dtype(
             'struct{n:int32,sum_x:float64,y_transpose_x:array<float64>,beta:array<float64>,standard_error:array<float64>,t_stat:array<float64>,p_value:array<float64>}'
         )
         self._type = hl.ttable(
             child_typ.global_type, (child_typ.row_key_type._insert_fields(
                 **{f: child_typ.row_type[f]
                    for f in pass_through})._concat(chained_schema)),
             child_typ.row_key)
     else:
         assert name == 'LogisticRegression', name
         pass_through = self.config['passThrough']
         logreg_type = hl.tstruct(logistic_regression=hl.tarray(
             regression_test_type(self.config['test'])))
         self._type = hl.ttable(
             child_typ.global_type, (child_typ.row_key_type._insert_fields(
                 **{f: child_typ.row_type[f]
                    for f in pass_through})._concat(logreg_type)),
             child_typ.row_key)
示例#2
0
文件: table_ir.py 项目: vedasha/hail
 def _compute_type(self):
     left_typ = self.left.typ
     right_typ = self.right.typ
     self._type = hl.ttable(
         left_typ.global_type,
         left_typ.row_type._insert_field(self.root, right_typ.value_type),
         left_typ.row_key)
示例#3
0
文件: table_ir.py 项目: jigold/hail
 def _compute_type(self):
     left_typ = self.left.typ
     right_typ = self.right.typ
     self._type = hl.ttable(
         left_typ.global_type,
         left_typ.row_type._insert_field(self.root, right_typ.value_type),
         left_typ.row_key)
示例#4
0
文件: table_ir.py 项目: vedasha/hail
 def _compute_type(self):
     # agg_env for scans
     self.new_row._compute_type(self.child.typ.row_env(), self.child.typ.row_env())
     self._type = hl.ttable(
         self.child.typ.global_type,
         self.new_row.typ,
         self.child.typ.row_key)
示例#5
0
文件: table_ir.py 项目: jigold/hail
 def _compute_type(self):
     child_typ = self.child.typ
     self._type = hl.ttable(child_typ.global_type,
                            child_typ.row_type
                            ._concat(child_typ.col_type)
                            ._concat(child_typ.entry_type),
                            child_typ.row_key + child_typ.col_key)
示例#6
0
文件: table_ir.py 项目: vedasha/hail
 def _compute_type(self):
     child_typ = self.child.typ
     self._type = hl.ttable(child_typ.global_type,
                            child_typ.row_type
                            ._concat(child_typ.col_type)
                            ._concat(child_typ.entry_type),
                            child_typ.row_key + child_typ.col_key)
示例#7
0
文件: table_ir.py 项目: jigold/hail
 def _compute_type(self):
     # agg_env for scans
     self.new_row._compute_type(self.child.typ.row_env(), self.child.typ.row_env())
     self._type = hl.ttable(
         self.child.typ.global_type,
         self.new_row.typ,
         self.child.typ.row_key)
示例#8
0
 def _compute_type(self):
     self.expr._compute_type(self.child.typ.global_env(),
                             self.child.typ.row_env())
     self.new_key._compute_type(self.child.typ.row_env(), None)
     self._type = hl.ttable(self.child.typ.global_type,
                            self.new_key.typ._concat(self.expr.typ),
                            list(self.new_key.typ))
示例#9
0
 def _compute_type(self):
     left_typ = self.left.typ
     right_typ = self.right.typ
     self._type = hl.ttable(
         left_typ.global_type._concat(right_typ.global_type),
         left_typ.key_type._concat(left_typ.value_type)._concat(
             right_typ.value_type),
         left_typ.row_key + right_typ.row_key[self.join_key:])
示例#10
0
 def _compute_type(self):
     child_typ = self.child.typ
     self._type = hl.ttable(
         child_typ.global_type._insert_field(self.cols_field_name,
                                             hl.tarray(child_typ.col_type)),
         child_typ.row_type._insert_field(self.entries_field_name,
                                          hl.tarray(child_typ.entry_type)),
         child_typ.row_key)
示例#11
0
 def _compute_type(self):
     self._type = hl.ttable(
         hl.tstruct(),
         hl.tstruct(**{
             'i': hl.tint64,
             'j': hl.tint64,
             'entry': hl.tfloat64
         }), [])
示例#12
0
文件: table_ir.py 项目: vedasha/hail
 def _compute_type(self):
     for c in self.children:
         c.typ # force
     child_typ = self.children[0].typ
     self._type = hl.ttable(
         hl.tstruct(**{self.global_name: hl.tarray(child_typ.global_type)}),
         child_typ.key_type._insert_field(self.data_name, hl.tarray(child_typ.value_type)),
         child_typ.row_key)
示例#13
0
文件: table_ir.py 项目: jigold/hail
 def _compute_type(self):
     for c in self.children:
         c.typ  # force
     child_typ = self.children[0].typ
     self._type = hl.ttable(
         hl.tstruct(**{self.global_name: hl.tarray(child_typ.global_type)}),
         child_typ.key_type._insert_field(self.data_name, hl.tarray(child_typ.value_type)),
         child_typ.row_key)
示例#14
0
文件: table_ir.py 项目: vedasha/hail
 def _compute_type(self):
     name = self.config['name']
     child_typ = self.child.typ
     if name == 'LinearRegressionRowsChained':
         pass_through = self.config['passThrough']
         chained_schema = hl.dtype('struct{n:array<int32>,sum_x:array<float64>,y_transpose_x:array<array<float64>>,beta:array<array<float64>>,standard_error:array<array<float64>>,t_stat:array<array<float64>>,p_value:array<array<float64>>}')
         self._type = hl.ttable(
             child_typ.global_type,
             (child_typ.row_key_type
              ._insert_fields(**{f: child_typ.row_type[f] for f in pass_through})
              ._concat(chained_schema)),
             child_typ.row_key)
     elif name == 'LinearRegressionRowsSingle':
         pass_through = self.config['passThrough']
         chained_schema = hl.dtype('struct{n:int32,sum_x:float64,y_transpose_x:array<float64>,beta:array<float64>,standard_error:array<float64>,t_stat:array<float64>,p_value:array<float64>}')
         self._type = hl.ttable(
             child_typ.global_type,
             (child_typ.row_key_type
              ._insert_fields(**{f: child_typ.row_type[f] for f in pass_through})
              ._concat(chained_schema)),
             child_typ.row_key)
     elif name == 'LogisticRegression':
         pass_through = self.config['passThrough']
         logreg_type = hl.tstruct(logistic_regression=hl.tarray(regression_test_type(self.config['test'])))
         self._type = hl.ttable(
             child_typ.global_type,
             (child_typ.row_key_type
              ._insert_fields(**{f: child_typ.row_type[f] for f in pass_through})
              ._concat(logreg_type)),
             child_typ.row_key)
     elif name == 'PoissonRegression':
         pass_through = self.config['passThrough']
         poisreg_type = regression_test_type(self.config['test'])
         self._type = hl.ttable(
             child_typ.global_type,
             (child_typ.row_key_type
              ._insert_fields(**{f: child_typ.row_type[f] for f in pass_through})
              ._concat(poisreg_type)),
             child_typ.row_key)
     elif name == 'Skat':
         key_field = self.config['keyField']
         key_type = child_typ.row_type[key_field]
         skat_type = hl.dtype(f'struct{{id:{key_type},size:int32,q_stat:float64,p_value:float64,fault:int32}}')
         self._type = hl.ttable(
             hl.tstruct(),
             skat_type,
             ['id'])
     elif name == 'PCA':
         self._type = hl.ttable(
             hl.tstruct(eigenvalues=hl.tarray(hl.tfloat64),
                        scores=hl.tarray(child_typ.col_key_type._insert_field('scores', hl.tarray(hl.tfloat64)))),
             child_typ.row_key_type._insert_field('loadings', dtype('array<float64>')),
             child_typ.row_key)
     else:
         assert name == 'LocalLDPrune', name
         self._type = hl.ttable(
             hl.tstruct(),
             child_typ.row_key_type._insert_fields(mean=hl.tfloat64, centered_length_rec=hl.tfloat64),
             list(child_typ.row_key))
示例#15
0
 def _compute_type(self):
     self.body._compute_type({self.global_name: self.child.typ.global_type,
                              self.partition_stream_name: hl.tstream(self.child.typ.row_type)},
                             {})
     assert isinstance(self.body.typ, hl.tstream) and isinstance(self.body.typ.element_type, hl.tstruct)
     new_row_type = self.body.typ.element_type
     for k in self.child.typ.row_key:
         assert k in new_row_type
     self._type = hl.ttable(self.child.typ.global_type,
                            new_row_type,
                            self.child.typ.row_key)
示例#16
0
 def _compute_type(self):
     name = self.config['name']
     assert name == 'PCRelate', name
     self._type = hl.ttable(
         hl.tstruct(),
         hl.tstruct(i=hl.tint32,
                    j=hl.tint32,
                    kin=hl.tfloat64,
                    ibd0=hl.tfloat64,
                    ibd1=hl.tfloat64,
                    ibd2=hl.tfloat64), ['i', 'j'])
示例#17
0
 def _compute_type(self):
     left_typ = self.left.typ
     right_typ = self.right.typ
     if self.product:
         right_val_typ = left_typ.row_type._insert_field(
             self.root, hl.tarray(right_typ.value_type))
     else:
         right_val_typ = left_typ.row_type._insert_field(
             self.root, right_typ.value_type)
     self._type = hl.ttable(left_typ.global_type, right_val_typ,
                            left_typ.row_key)
示例#18
0
文件: table_ir.py 项目: jigold/hail
 def _compute_type(self):
     self.expr._compute_type(self.child.typ.global_env(), self.child.typ.row_env())
     self.new_key._compute_type(self.child.typ.row_env(), None)
     self._type = hl.ttable(self.child.typ.global_type,
                            self.new_key.typ._concat(self.expr.typ),
                            list(self.new_key.typ))
示例#19
0
文件: table_ir.py 项目: vedasha/hail
 def _compute_type(self):
     child_typ = self.child.typ
     self.expr._compute_type(child_typ.global_env(), child_typ.row_env())
     self._type = hl.ttable(child_typ.global_type,
                            child_typ.key_type._concat(self.expr.typ),
                            child_typ.row_key)
示例#20
0
文件: table_ir.py 项目: vedasha/hail
 def _compute_type(self):
     atyp = self.child.typ.row_type._index_path(self.path)
     self._type = hl.ttable(self.child.typ.global_type,
                            self.child.typ.row_type._insert(self.path, atyp.element_type),
                            self.child.typ.row_key)
示例#21
0
文件: table_ir.py 项目: jigold/hail
 def _compute_type(self):
     child_typ = self.child.typ
     self.expr._compute_type(child_typ.global_env(), child_typ.row_env())
     self._type = hl.ttable(child_typ.global_type,
                            child_typ.key_type._concat(self.expr.typ),
                            child_typ.row_key)
示例#22
0
文件: table_ir.py 项目: jigold/hail
 def _compute_type(self):
     name = self.config['name']
     child_typ = self.child.typ
     if name == 'LinearRegressionRowsChained':
         pass_through = self.config['passThrough']
         chained_schema = hl.dtype(
             'struct{n:array<int32>,sum_x:array<float64>,y_transpose_x:array<array<float64>>,beta:array<array<float64>>,standard_error:array<array<float64>>,t_stat:array<array<float64>>,p_value:array<array<float64>>}')
         self._type = hl.ttable(
             child_typ.global_type,
             (child_typ.row_key_type
              ._insert_fields(**{f: child_typ.row_type[f] for f in pass_through})
              ._concat(chained_schema)),
             child_typ.row_key)
     elif name == 'LinearRegressionRowsSingle':
         pass_through = self.config['passThrough']
         chained_schema = hl.dtype(
             'struct{n:int32,sum_x:float64,y_transpose_x:array<float64>,beta:array<float64>,standard_error:array<float64>,t_stat:array<float64>,p_value:array<float64>}')
         self._type = hl.ttable(
             child_typ.global_type,
             (child_typ.row_key_type
              ._insert_fields(**{f: child_typ.row_type[f] for f in pass_through})
              ._concat(chained_schema)),
             child_typ.row_key)
     elif name == 'LogisticRegression':
         pass_through = self.config['passThrough']
         logreg_type = hl.tstruct(logistic_regression=hl.tarray(regression_test_type(self.config['test'])))
         self._type = hl.ttable(
             child_typ.global_type,
             (child_typ.row_key_type
              ._insert_fields(**{f: child_typ.row_type[f] for f in pass_through})
              ._concat(logreg_type)),
             child_typ.row_key)
     elif name == 'PoissonRegression':
         pass_through = self.config['passThrough']
         poisreg_type = regression_test_type(self.config['test'])
         self._type = hl.ttable(
             child_typ.global_type,
             (child_typ.row_key_type
              ._insert_fields(**{f: child_typ.row_type[f] for f in pass_through})
              ._concat(poisreg_type)),
             child_typ.row_key)
     elif name == 'Skat':
         key_field = self.config['keyField']
         key_type = child_typ.row_type[key_field]
         skat_type = hl.dtype(f'struct{{id:{key_type},size:int32,q_stat:float64,p_value:float64,fault:int32}}')
         self._type = hl.ttable(
             hl.tstruct(),
             skat_type,
             ['id'])
     elif name == 'PCA':
         self._type = hl.ttable(
             hl.tstruct(eigenvalues=hl.tarray(hl.tfloat64),
                        scores=hl.tarray(child_typ.col_key_type._insert_field('scores', hl.tarray(hl.tfloat64)))),
             child_typ.row_key_type._insert_field('loadings', dtype('array<float64>')),
             child_typ.row_key)
     else:
         assert name == 'LocalLDPrune', name
         self._type = hl.ttable(
             hl.tstruct(),
             child_typ.row_key_type._insert_fields(mean=hl.tfloat64, centered_length_rec=hl.tfloat64),
             list(child_typ.row_key))
示例#23
0
文件: table_ir.py 项目: vedasha/hail
 def _compute_type(self):
     self.new_row._compute_type(self.child.typ.global_env(), None)
     self._type = hl.ttable(self.new_row.typ,
                            self.child.typ.row_type,
                            self.child.typ.row_key)
示例#24
0
文件: table_ir.py 项目: vedasha/hail
 def _compute_type(self):
     self._type = hl.ttable(self.child.typ.global_type,
                            self.child.typ.row_type,
                            [])
示例#25
0
文件: table_ir.py 项目: jigold/hail
 def _compute_type(self):
     self.new_globals._compute_type(self.child.typ.global_env(), None)
     self._type = hl.ttable(self.new_globals.typ,
                            self.child.typ.row_type,
                            self.child.typ.row_key)
示例#26
0
文件: table_ir.py 项目: jigold/hail
 def _compute_type(self):
     self.rows_and_global._compute_type({}, None)
     self._type = hl.ttable(self.rows_and_global.typ['global'],
                            self.rows_and_global.typ['rows'].element_type,
                            [])
示例#27
0
文件: table_ir.py 项目: vedasha/hail
 def _compute_type(self):
     self._type = hl.ttable(self.child.typ.global_type,
                            self.child.typ.col_type,
                            self.child.typ.col_key)
示例#28
0
文件: table_ir.py 项目: jigold/hail
 def _compute_type(self):
     self._type = hl.ttable(self.child.typ.global_type,
                            self.child.typ.row_type,
                            [])
示例#29
0
文件: table_ir.py 项目: jigold/hail
 def _compute_type(self):
     self._type = hl.ttable(hl.tstruct(),
                            hl.tstruct(idx=hl.tint32),
                            ['idx'])
示例#30
0
    def _compute_type(self):
        child_typ = self.child.typ

        self._type = hl.ttable(child_typ.global_type,
                               child_typ.key_type._insert_field(self.name, hl.tarray(child_typ.row_type)),
                               child_typ.row_key)
示例#31
0
文件: table_ir.py 项目: jigold/hail
 def _compute_type(self):
     left_typ = self.left.typ
     right_typ = self.right.typ
     self._type = hl.ttable(left_typ.global_type._concat(right_typ.global_type),
                            left_typ.key_type._concat(left_typ.value_type)._concat(right_typ.value_type),
                            left_typ.row_key + right_typ.row_key[self.join_key:])
示例#32
0
文件: table_ir.py 项目: jigold/hail
 def _compute_type(self):
     self._type = hl.ttable(hl.tstruct(), hl.tstruct(**{'i': hl.tint64, 'j': hl.tint64, 'entry': hl.tfloat64}), [])
示例#33
0
文件: table_ir.py 项目: vedasha/hail
 def _compute_type(self):
     self.rows_and_global._compute_type({}, None)
     self._type = hl.ttable(self.rows_and_global.typ['global'],
                            self.rows_and_global.typ['rows'].element_type,
                            [])
示例#34
0
文件: table_ir.py 项目: jigold/hail
 def _compute_type(self):
     self._type = hl.ttable(self.child.typ.global_type,
                            self.child.typ.col_type,
                            self.child.typ.col_key)
示例#35
0
文件: table_ir.py 项目: jigold/hail
 def _compute_type(self):
     atyp = self.child.typ.row_type._index_path(self.path)
     self._type = hl.ttable(self.child.typ.global_type,
                            self.child.typ.row_type._insert(self.path, atyp.element_type),
                            self.child.typ.row_key)
示例#36
0
文件: table_ir.py 项目: vedasha/hail
 def _compute_type(self):
     self._type = hl.ttable(hl.tstruct(),
                            hl.tstruct(idx=hl.tint32),
                            ['idx'])
示例#37
0
文件: table_ir.py 项目: tpoterba/hail
    def _compute_type(self):
        child_typ = self.child.typ

        self._type = hl.ttable(child_typ.global_type,
                               child_typ.key_type._concat(hl.tstruct(grouped_fields=hl.tarray(child_typ.row_type))),
                               child_typ.row_key)
示例#38
0
文件: table_ir.py 项目: jigold/hail
 def _compute_type(self):
     child_typ = self.child.typ
     self._type = hl.ttable(child_typ.global_type._insert_field(self.cols_field_name, hl.tarray(child_typ.col_type)),
                            child_typ.row_type._insert_field(self.entries_field_name,
                                                             hl.tarray(child_typ.entry_type)),
                            child_typ.row_key)