-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add option to pre-warp to a common projection #601
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## develop #601 +/- ##
===========================================
- Coverage 81.23% 81.07% -0.17%
===========================================
Files 130 130
Lines 5857 5876 +19
===========================================
+ Hits 4758 4764 +6
- Misses 1099 1112 +13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Looks good so far (assuming xargs parallelization works well), but as I comment below, don't you need a dependency so the unify_projection job finishes completely before running the pixetl job?
|
||
jobs.append( | ||
await create_pixetl_job( | ||
dataset, version, creation_options, "create_raster_tile_set", callback |
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.
***In the case the unify_projection
is True, don't you need to specify a parent dependency argument here? The create_unify_projection_job
must run fully before the create_pixetl_job
runs.
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.
Yep, thanks!
batch/scripts/unify_projection.sh
Outdated
mkdir -p "$reprojected_dir" | ||
|
||
cd $source_dir | ||
for d in $((tree -dfi)); do |
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.
I think you mean $(tree -dfi) here (only one set of parens). Also, I guess we are sure the docker has the 'tree' command in it? You could use 'find' here as well.
I guess this may not matter right now, since our source URIs don't current have sub-directories of files.
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.
I wasn't sure, I'll admit that was a try-it-and-see commit. It turns out we don't, and I've replaced the tree command with a find. Thanks for the parenthesis hint!
batch/scripts/unify_projection.sh
Outdated
if [[ $s == gs://* ]]; then | ||
gsutil cp -m -r "$s" "$source_dir" | ||
elif [[ $s == s3://* ]]; then | ||
aws s3 cp --no-progress "$s" "$source_dir" |
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.
I know we're not using aws for the source_uri, but shouldn't this have "--recursive" on it to copy an entire folder path and sub-folders?
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.
Good catch, thanks!
You're right, thanks! |
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.
I appreciate all the descriptions, @dmannarino . 👍
No tests? 🤷
raster_tile_set_asset
is getting kinda long. Did you consider decomposing that function? Just curious.
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.
Looks good! Let's get it pushed into staging and try it out on the dist alerts composites!
callback: Callback = callback_constructor(asset_id) | ||
|
||
create_raster_tile_set_job: Job = await create_pixetl_job( | ||
dataset, version, creation_options, "create_raster_tile_set", callback | ||
unify_job: Job | None = None |
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.
I think "Job | None" is more usually expressed as Optional[Job], probably more readable.
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.
If you think it's more readable, I'll change it! It's true that it had to be expressed as you say until Python 3.10. This is my first time actually using the new syntax.
# | ||
# USAGE: ./crosses_dateline.sh infile [outfile] | ||
# | ||
# if no outfile is given, the script returns "true" or "false" |
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.
I think with the current modifications, there is no outfile arg, so maybe fix lines 6 and 8?
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.
You're right, thanks!
callback: Callback | ||
): | ||
""" | ||
""" |
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.
Can you add a function comment here? Mainly would be that target_prefix is where the folders of warped files are placed, under SRC_0, SRC_1, SRC_2, etc.
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.
Done, thanks!
True. Let me decompose and write a test as a follow-up. |
|
||
crossing_dateline=false | ||
test $(python -c "print(${ulx}>${lrx})") = True && crossing_dateline=true | ||
test $(python -c "print(${ulx}>${lrx})") = True && crossing_dateline=true |
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.
@dmannarino: lines 37 and 38 look identical, just a duplicate or meant to check a different condition?
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.
Oooh, good catch! It looks like I messed this up copying and pasting! They are meant to check a different condition. Will fix, thanks!
Pull request checklist
Please check if your PR fulfills the following requirements:
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this introduce a breaking change?
Other information