Esempio n. 1
0
 def decode(cls, encoding, spec, df):
     binners = encoding.decode_list('binner', spec['binners'])
     task = cls(df, binners)
     aggs = encoding.decode_list('aggregation', spec['aggregations'])
     for agg in aggs:
         agg._prepare_types(df)
         task.add_aggregation_operation(agg)
     return task
Esempio n. 2
0
 def decode(cls, encoding, spec, df, nthreads):
     # aggs = [vaex.agg._from_spec(agg_spec) for agg_spec in spec['aggregations']]
     aggs = encoding.decode_list('aggregation', spec['aggregations'])
     dtypes = encoding.decode_dict('dtype', spec['dtypes'])
     grid = encoding.decode_list('binner-cpu', spec['binners'], nthreads=nthreads)
     values = encoding.decode_list2('ndarray', spec['values']) if 'values' in spec else None
     # dtypes = {expr: _deserialize_type(type_spec) for expr, type_spec in spec['dtypes'].items()}
     for agg in aggs:
         agg._prepare_types(df)
     return cls(df, grid, aggs, dtypes, initial_values=values, nthreads=nthreads)
Esempio n. 3
0
 def decode(cls, encoding, spec, df):
     grid = encoding.decode('grid', spec['grid'])
     task = cls(df, grid)
     aggs = encoding.decode_list('aggregation', spec['aggregations'])
     for agg in aggs:
         agg._prepare_types(df)
         task.add_aggregation_operation(agg)
     return task
Esempio n. 4
0
 def decode(cls, encoding, spec, df):
     # aggs = [vaex.agg._from_spec(agg_spec) for agg_spec in spec['aggregations']]
     aggs = encoding.decode_list('aggregation', spec['aggregations'])
     dtypes = encoding.decode_dict('dtype', spec['dtypes'])
     grid = encoding.decode('grid', spec['grid'])
     # dtypes = {expr: _deserialize_type(type_spec) for expr, type_spec in spec['dtypes'].items()}
     for agg in aggs:
         agg._prepare_types(df)
     return cls(df, grid, aggs, dtypes)
Esempio n. 5
0
 def decode(cls, encoding, spec, df):
     binners = tuple(encoding.decode_list('binner', spec['binners']))
     agg = encoding.decode('aggregation', spec['aggregation'])
     task = cls(df, binners, agg)
     return task