TaipanRex / pyvisgraph

Given a list of simple obstacle polygons, build the visibility graph and find the shortest path between two points
MIT License
221 stars 45 forks source link

Progressbar output not functional for workers>1 #31

Closed tjansson60 closed 6 years ago

tjansson60 commented 6 years ago

As I have mentioned before I really enjoy your project and I have an idea for an improvement.

One worker
When building a graph from polygons derived from shorelines such as GSHHS_c_L1 containing 742 shapes using 1 worker the output works nicely even though there is no indication in time when it will be done:

[Done][Rem.][Avg t]                                                                                                     
[  79][1608][0.051]                                                                                                     

This is sufficient for small graphs, but complex sets of polygons such as the intermediate shoreline set as GSHHS_i_L1 this can take a long time with one worker and with a time estimate it is even harder to plan around and perhaps do over the weekend.

More than one worker
Using more than one worker the different workers overwrite the progress output on the same line and the output is garbled and it is even harder to find out when the process will be done. Using say 16 workers it is almost impossible to decipher the progress.

 [Done][Rem.][Avg t] [Done][Rem.][Avg t] [Done][Rem.][Avg t] [Done][Rem.][Avg t] 
[63.0C[ 281][ 140][0.059]

Proposed solution I was thinking of rewriting the current progress bar with a modern alternative such as tqdm or progressbar2, but wanted to make sure that this is inline with your thoughts on the progress bar before I started.

tjansson60 commented 6 years ago

I have made a pull request now with the implementation of a tqdm progressbar you can check out.

TaipanRex commented 6 years ago

Solved with dde738529c5