-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make downloading more windows-friendly #2810
Make downloading more windows-friendly #2810
Conversation
@@ -143,10 +144,10 @@ def download_capture_name(save_dir: Path, dataset_name: str, capture_name: str, | |||
file_id_or_zip_url = capture_name_to_file_id[capture_name] | |||
if file_id_or_zip_url.endswith(".zip"): | |||
url = file_id_or_zip_url # zip url | |||
target_path = str(save_dir / f"{dataset_name}/{capture_name}") | |||
target_path = str(save_dir / f"{dataset_name}" / f"{capture_name}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider simplifying this and other similar changes:
target_path = str(save_dir / f"{dataset_name}" / f"{capture_name}") | |
target_path = str(save_dir / dataset_name / capture_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, midnight brain wasn't thinking too hard. I'll fix this.
5faada3
to
bd0ac70
Compare
Fixed. Also rebased the changes to be on top of master again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks @VasuAgrawal @cr333!!
* Make downloading more windows-friendly * Remove unnecessary f-strings
I ran into a few issues while running the various download commands on my Windows box. This diff attempts to remedy those issues. In no particular order:
os.system
tosubprocess.run
calls, which have better handling of'
vs"
and other shell escapes. In particular, the'
which were previously used (line 431) weren't working in CMD, which is used byos.system
on my machine. They work fine in powershell, though.curl
call to use-o
flag to directly output to file, rather than going through IO redirection..temp
. This allows multiple download jobs to run concurrently, since they're typically rate-limited by the upstream.