Addresses DEM download issues#56
Addresses DEM download issues#56Alex-Lewandowski wants to merge 4 commits intoforrestfwilliams:developfrom
Conversation
…h.download_file()
src/multirtc/fetch.py
Outdated
| if chunk: | ||
| f.write(chunk) | ||
| bytes_written += len(chunk) | ||
| if bytes_written == 0: |
There was a problem hiding this comment.
Hey just looking at these lines. Are we sure the behavior we want is for the function to continue returning an empty string if the download fails? I'd prefer the function to fail if the download fails. Like the extra messaging though.
There was a problem hiding this comment.
Yeah, that makes sense. I'll replace those with raised exceptions.
There was a problem hiding this comment.
I removed the check for zero bytes (probably unnecessary), replaced the empty-string return with a raise, and added logic to delete partially downloaded data if an exception is raised.
|
Also will need to update the changelog. |
|
Also @Alex-Lewandowski there's a test for the nisar dem url that you'll need to update as well. |
…ions and delete partial downloads in fetch.py
|
@forrestfwilliams We received guidance that the DEM should be referred to as the "Modified Copernicus DEM for NISAR," so I updated references to the "OPERA DEM." |
|
Thanks for the review, @forrestfwilliams! You'll have to hit the merge button. I don't have write permission. |
Version 1.1 of the NISAR DEM was pulled and replaced with v1.2, which has updated endpoints.
This PR:
dem.py.fetch.download_file()to enable easier debugging the next time expected data vanishes.