Exemple #1
0
    def __init__(self, path):
        self.file_id = LazyResult.generate_file_id(Table._FILE_FORMAT)
        LazyResult.register_lazy_file(self.file_id, self)

        self.path = path
        header_df = self.read_metadata()
        # the params used to lazy_slice_rows and lazy_skip_columns
        self.slice_start = None
        self.nrows = None
        self.usecols = list(header_df)

        self.columns = self._create_columns(header_df)
Exemple #2
0
    def __init__(self, path, variables=None, dimensions=None):
        self.file_id = LazyResult.generate_file_id(Dataset._FILE_FORMAT)
        LazyResult.register_lazy_file(self.file_id, self)

        self.path = path
        self.ds = self.read_metadata()

        if variables is None:
            self.variables = self._create_variables()
        else:
            self.variables = variables

        if dimensions is None:
            self.dimensions = OrderedDict(
                map(lambda kv: (kv[0], kv[1].size),
                    self.ds.dimensions.items()))
        else:
            self.dimensions = dimensions

        self._columns = [k for k in self.variables if k not in self.dimensions]