Skip to content

Commit

Permalink
Adding cascade for pbar and tqdm for sort
Browse files Browse the repository at this point in the history
  • Loading branch information
root-11 committed Nov 24, 2023
1 parent 6ddf7d0 commit 9dcb835
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions tablite/sortation.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ def reindex(T, index):
return m(T, index)


def _sp_reindex(T, index):
return _reindex(T, index)
def _sp_reindex(T, index, tqdm=_tqdm, pbar=None):
return _reindex(T, index, tqdm=tqdm, pbar=pbar)


def _mp_reindex(T, index):
def _mp_reindex(T, index, tqdm=_tqdm, pbar=None):
assert isinstance(index, np.ndarray)
return _sp_reindex(T, index)
return _sp_reindex(T, index, tqdm=tqdm, pbar=pbar)

index, shm = share_mem(index, dtype=index.dtype)
# shm = shared_memory.SharedMemory(create=True, size=index.nbytes) # the co_processors will read this.
Expand Down Expand Up @@ -154,7 +154,7 @@ def sort(T, mapping, sort_mode="excel", tqdm=_tqdm, pbar: _tqdm = None):

index = sort_index(T, mapping, sort_mode=sort_mode, tqdm=_tqdm, pbar=pbar)
m = select_processing_method(len(T) * len(T.columns), _sp_reindex, _mp_reindex)
return m(T, index)
return m(T, index, tqdm=tqdm, pbar=pbar)


def is_sorted(T, mapping, sort_mode="excel"):
Expand Down
2 changes: 1 addition & 1 deletion tablite/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
major, minor, patch = 2023, 8, 10
major, minor, patch = 2023, 8, 11
__version_info__ = (major, minor, patch)
__version__ = ".".join(str(i) for i in __version_info__)

0 comments on commit 9dcb835

Please sign in to comment.