Skip to content

Commit

Permalink
Fixed bug with module import in __init__.py;
Browse files Browse the repository at this point in the history
  • Loading branch information
padu committed Jul 25, 2022
1 parent a7360e5 commit 239b1cf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ It looks good, doesn't it? But let's do the following, make the first task very
if __name__=='__main__':
with Pool() as p:
tasks = [20 + i for i in range(15)]
tasks.insert(1, 38)
tasks.insert(0, 39)
pool = p.imap_unordered(fibonacci, tasks)
result = []
for i in tqdm(pool, total=len(tasks)):
Expand All @@ -196,10 +196,9 @@ Let's try to do the same experiment only for the progress_imap function:

```python
if __name__=='__main__':
with Pool() as p:
tasks = [20 + i for i in range(15)]
tasks.insert(1, 38)
result = progress_imap(fibonacci, tasks)
tasks = [20 + i for i in range(15)]
tasks.insert(0, 39)
result = progress_imap(fibonacci, tasks)
```

![](https://raw.githubusercontent.com/dubovikmaster/parallelbar/main/gifs/imap_naive_3.gif)
Expand Down
5 changes: 0 additions & 5 deletions parallelbar/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
import os
import sys

sys.path.append(os.path.dirname(os.path.realpath(__file__)))

from .parallelbar import progress_map, progress_imap, progress_imapu

__all__ = ['progress_map', 'progress_imap', 'progress_imapu']
4 changes: 2 additions & 2 deletions parallelbar/parallelbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from concurrent.futures import TimeoutError

from tqdm.auto import tqdm
from tools import get_len
from tools import _wrapped_func
from .tools import get_len
from .tools import _wrapped_func


class ProgressBar(tqdm):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name='parallelbar',
version='0.2.13',
version='0.2.14',
packages=find_packages(),
author='Dubovik Pavel',
author_email='geometryk@gmail.com',
Expand Down

0 comments on commit 239b1cf

Please sign in to comment.