Open mmterpstra opened 2 years ago
here is the same error in 1.6.2:
Traceback (most recent call last):
File "/home/terpstramm/.local/bin/gsport", line 11, in <module>
sys.exit(main())
File "/home/terpstramm/.local/lib/python3.6/site-packages/gsport.py", line 455, in main
download_all(session)
File "/home/terpstramm/.local/lib/python3.6/site-packages/gsport.py", line 438, in download_all
"ETA:", human_readable_eta((dl_sum - downloaded_bytes) / rate),
ZeroDivisionError: float division by zero
Interesting. I tweaked gsport
myself and got rid of that ETA. It would be nice to replace that code with a decent progress indicator like tqdm
. If you don't need it, just comment out lines 433-439 (and perhaps comment lines 240-244 and add pass
in the same indent block to prevent an IndentationError
).
You can also try to add + 1
to rate
at line 432 to make sure it is never zero (with the side effect that the ETA is a little off).
432 │ rate = downloaded_bytes // (time.time() - start) + 1
I am not working for GenomeScan, nor do I maintain this program. ;-)
Thanks!
fixed with:
if rate > 0:
print("\r", str(round(downloaded_bytes / dl_sum * 100))+"%",
"Downloading", sizeofmetric_fmt(downloaded_bytes), "of",
sizeofmetric_fmt(dl_sum),
str(sizeofmetric_fmt(rate)) + "/sec",
"ETA:", human_readable_eta((dl_sum - downloaded_bytes) / rate),
end=' ')
elif rate == 0:
print("\r", str(round(downloaded_bytes / dl_sum * 100))+"%",
"Downloading", sizeofmetric_fmt(downloaded_bytes), "of",
sizeofmetric_fmt(dl_sum),
str(sizeofmetric_fmt(rate)) + "/sec",
"ETA:", "Never",
end=' ')
It seems to start the download. Although still a bit jank probably due to my setup... ( it seems to work by only downloading the Demux folder --cd Demux
though...)
"Never"
, nice fix. 😄
I keep having this with a project with the project name matching \d{6}-\d{3} eg 100001-001. Tried it with a regular project matching \d{6} and this works... (also gives the same error on 1.6.2).
command ran