Exemplo n.º 1
0
    def to_zip_npz(self,
                   fp: PathSpecifier,
                   *,
                   config: StoreConfigMapInitializer = None) -> None:
        '''
        Write the complete :obj:`Bus` as a zipped archive of NPZ files.

        {args}
        '''
        store = StoreZipNPZ(fp)
        config = self._filter_config(config)
        store.write(self._items_store(), config=config)
Exemplo n.º 2
0
    def test_store_zip_npz_a(self) -> None:

        f1, f2 = get_test_framesB()

        config = StoreConfig()

        with temp_file('.zip') as fp:
            st = StoreZipNPZ(fp)
            st.write(((f.name, f) for f in (f1, f2)), config=config)

            post = tuple(st.read_many(('a', 'b'),
                    container_type=Frame,
                    config=config,
                    ))

            self.assertIs(post[0].index.__class__, IndexDate)
            self.assertIs(post[1].index.__class__, IndexDate)
Exemplo n.º 3
0
    def from_zip_npz(cls,
            fp: PathSpecifier,
            *,
            config: StoreConfigMapInitializer = None,
            max_persist: tp.Optional[int] = None,
            index_constructor: IndexConstructor = None,
            ) -> 'Bus':
        '''
        Given a file path to zipped parquet :obj:`Bus` store, return a :obj:`Bus` instance.

        {args}
        '''
        store = StoreZipNPZ(fp)
        return cls._from_store(store,
                config=config,
                max_persist=max_persist,
                index_constructor=index_constructor,
                )
Exemplo n.º 4
0
    def from_zip_npz(cls,
            fp: PathSpecifier,
            *,
            config: StoreConfigMapInitializer = None,
            axis: int = 0,
            retain_labels: bool,
            deepcopy_from_bus: bool = False,
            max_persist: tp.Optional[int] = None,
            ) -> 'Quilt':
        '''
        Given a file path to zipped parquet :obj:`Quilt` store, return a :obj:`Quilt` instance.

        {args}
        '''
        store = StoreZipNPZ(fp)
        return cls._from_store(store,
                config=config,
                axis=axis,
                retain_labels=retain_labels,
                deepcopy_from_bus=deepcopy_from_bus,
                max_persist=max_persist,
                )
Exemplo n.º 5
0
    def from_zip_npz(
        cls,
        fp: PathSpecifier,
        *,
        config: StoreConfigMapInitializer = None,
        max_workers: tp.Optional[int] = None,
        chunksize: int = 1,
        use_threads: bool = False,
    ) -> 'Batch':
        '''
        Given a file path to zipped NPZ :obj:`Batch` store, return a :obj:`Batch` instance.

        {args}
        '''
        store = StoreZipNPZ(fp)
        return cls._from_store(
            store,
            config=config,
            max_workers=max_workers,
            chunksize=chunksize,
            use_threads=use_threads,
        )