-
Notifications
You must be signed in to change notification settings - Fork 70
Interrupted Batch downloads can be resumed #2654
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
Conversation
d07aa9c to
9e08bd1
Compare
f97393b to
b33daf1
Compare
9e08bd1 to
2d38bb2
Compare
62f1aa3 to
ac85a54
Compare
c0bd4f2 to
ee0a307
Compare
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.
Reviewing changes made in this pull request
96f32b2 to
8e87a89
Compare
yaugenst-flex
left a comment
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.
Thanks @jewettaijfc! Left some (mostly minor) comments.
6748c8d to
2ee3551
Compare
Diff CoverageDiff: origin/develop...HEAD, staged and unstaged changes
Summary
tidy3d/web/api/container.py |
|
I tested the latest version using test_pr2654.py.zip. The new log.warning() message contains a link to the list of skipped files. This PR is ready for review again. |
a349f23 to
46ec978
Compare
yaugenst-flex
left a comment
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.
Thanks @jewettaijfc! Minor comment about argument defaults but looks almost ready to go.
46ec978 to
bc414fd
Compare
935d2d5 to
fd159e0
Compare
yaugenst-flex
left a comment
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!
…atchData.load(). Moved Batch.download() out of Batch.run() and into Batch.load(). BatchData.load_sim_data() invokes web.load() with replace_existing=True. (Previously it was False.)
126cc20 to
9041b3d
Compare
This PR addresses issue #2600
This PR:
replace_existingargument toBatch.load(),Batch.download(), andBatchData.load()functions fromcontainer.py. This allows these functions to skip over previously downloaded files.replace_existingisFalse.replace_existing==True).Batch.download()out ofBatch.run()and intoBatch.load().BatchData.load_sim_data()(which downloads only one file) now invokesweb.load()withreplace_existing=True, instead ofFalse. (This change was made to be consistent with the other single-file download functions. See below.)Single-file download functions overwrite existing files
There are also at least 10 different functions in
container.py,webapi.py, ands3utils.pywhich download only a single simulation file. After this PR, all of these single-file functions have the opposite behavior: They will overwrite a previously downloaded file. (Previously, some did and others did not.)I think this should be the default behavior for functions that download single files: It is the responsibility of the user to decide whether or not to download the file.
Discussion
For batch simulations, I think the situation is different because it's unreasonable to ask users to specify all of the files they want to download manually. That's why I only make it possible to automatically skip previously downloaded batch simulation files.
How to test this code
This code is particularly difficult code to write a unit test for (since it requires mocking in a multi-threaded environment). Instead I tested it manually.
Test strategy
Detailed test instructions:
Then follow the instructions in this file: test_pr2654.py.zip