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)
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)