diff --git a/pecos/core/base.py b/pecos/core/base.py index 6b650aa..1c4cdfd 100644 --- a/pecos/core/base.py +++ b/pecos/core/base.py @@ -1925,7 +1925,7 @@ def link_mmap_valstore_methods(self): self.mmap_valstore_fn_dict = { "float32": self._get_float32_mmap_valstore_methods(), - "bytes": self._get_bytes_mmap_valstore_methods(), + "str": self._get_bytes_mmap_valstore_methods(), } def mmap_valstore_init(self, store_type): diff --git a/pecos/utils/mmap_valstore_util.py b/pecos/utils/mmap_valstore_util.py index f6dd50f..f306353 100644 --- a/pecos/utils/mmap_valstore_util.py +++ b/pecos/utils/mmap_valstore_util.py @@ -87,7 +87,7 @@ class MmapValStoreBatchGetter(object): Args: max_row_size: Maximum row size max_col_size: Maximum column size - trunc_val_len (Optional): Applicable for bytes value only. Truncated max length. + trunc_val_len (Optional): Applicable for str value only. Truncated max length. threads (Optional): Number of threads to use. """ @@ -171,7 +171,7 @@ def get(self, rows, cols): self.val_prealloc.ret_vals, self.threads_c_uint32, ) - return self.val_prealloc.get_ret_memoryview(n_rows, n_cols) + return self.val_prealloc.format_ret(n_rows, n_cols) class _MmapValStoreBase(object): @@ -213,8 +213,8 @@ def init(cls, store_type, store_dir, lazy_load): if store_type == "float32": return _MmapValStoreFloat32ReadOnly(store_ptr, fn_dict) - elif store_type == "bytes": - return _MmapValStoreBytesReadOnly(store_ptr, fn_dict) + elif store_type == "str": + return _MmapValStoreStrReadOnly(store_ptr, fn_dict) else: raise NotImplementedError(f"{store_type}") @@ -245,29 +245,17 @@ def __init__(self, max_row_size: int, max_col_size: int): self.ret_vals = self.vals_ptr - def get_ret_memoryview(self, n_rows, n_cols): + def format_ret(self, n_rows, n_cols): """ - Reshape return into desired shape (row-major), so elements could be retrieved by indices: - ret[i, j], 0<=i