Closed osgeokr closed 6 months ago
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
🎉 Great! Next steps:
Let us know if you have any questions!
Thanks for fixing the issues that came up during automated checks! All have passed. I should be able to review by the end of next week.
View / edit / reply to this conversation on ReviewNB
jdbcode commented on 2024-02-20T22:57:31Z ----------------------------------------------------------------
Author
needs to be your GitHub ID (osgeokr)
jdbcode commented on 2024-03-13T20:24:30Z ----------------------------------------------------------------
Done
View / edit / reply to this conversation on ReviewNB
jdbcode commented on 2024-02-20T22:57:32Z ----------------------------------------------------------------
I suggest you choose one visualization of the data - my preference is the heatmap. Since they both convey the same info, it is redundant and a little confusing. Maybe I'm missing an important point though?
jdbcode commented on 2024-03-13T20:33:05Z ----------------------------------------------------------------
Done
View / edit / reply to this conversation on ReviewNB
jdbcode commented on 2024-02-20T22:57:33Z ----------------------------------------------------------------
For style consistency, please use "snake_case" for variable names throughout.
jdbcode commented on 2024-03-13T21:21:17Z ----------------------------------------------------------------
Done
View / edit / reply to this conversation on ReviewNB
jdbcode commented on 2024-02-20T22:57:34Z ----------------------------------------------------------------
GrainSize
is a parameter, I wouldn't mention 1km in the code comment.scale
argument in sampleRegions
- my intuition says that it should either be set by GrainSize
or left blank to default to scale of image's first band (this is less explicit though)Data
var name should be lowercase for style consistencyrand_point_vals
line on a second line to get line length closer to 80 charjdbcode commented on 2024-03-13T20:38:40Z ----------------------------------------------------------------
Done
View / edit / reply to this conversation on ReviewNB
jdbcode commented on 2024-02-20T22:57:34Z ----------------------------------------------------------------
jdbcode commented on 2024-03-13T20:39:27Z ----------------------------------------------------------------
Done
View / edit / reply to this conversation on ReviewNB
jdbcode commented on 2024-02-20T22:57:35Z ----------------------------------------------------------------
Suggest to chain all methods to avoid defining MedianTCC twice. Also nit reminder of preferred var name style as all lower snake_case
MedianTCC = TCC.filterDate('2000-01-01', '2015-12-31').select( ['tree_canopy_cover'], ['TCC']).median()
Done
View / edit / reply to this conversation on ReviewNB
jdbcode commented on 2024-02-20T22:57:36Z ----------------------------------------------------------------
Was setting tileScale
to 16 necessary to avoid memory issues? If not, it would be best practice to leave it as default. (I tried using the default and it was successful, but I had just run the analysis with tileScale=16 so I may have benefited from cached data)
jdbcode commented on 2024-03-13T21:03:31Z ----------------------------------------------------------------
Done
View / edit / reply to this conversation on ReviewNB
jdbcode commented on 2024-02-20T22:57:37Z ----------------------------------------------------------------
Including the cell values text makes the graphic really busy and I little hard to interpret and the text is quite small and sort of concatenated. I think it might be better to not include the individual cell labels. Maybe the labels are optional with a boolean parameter, because they are nice in the filtered var plot.
jdbcode commented on 2024-03-13T21:04:44Z ----------------------------------------------------------------
Done
View / edit / reply to this conversation on ReviewNB
jdbcode commented on 2024-02-20T22:57:37Z ----------------------------------------------------------------
ee.Reducer.minMax()
instead of min and max separately - I believe it works as a single pass so should be a bit faster and less code jdbcode commented on 2024-03-13T21:07:22Z ----------------------------------------------------------------
Done
View / edit / reply to this conversation on ReviewNB
jdbcode commented on 2024-02-20T22:57:38Z ----------------------------------------------------------------
Same as above: reduce line length, consider minMax reducer
jdbcode commented on 2024-03-13T21:08:40Z ----------------------------------------------------------------
Done
View / edit / reply to this conversation on ReviewNB
jdbcode commented on 2024-02-20T22:57:39Z ----------------------------------------------------------------
Try to reduce line length to near 80 char
jdbcode commented on 2024-03-13T21:08:54Z ----------------------------------------------------------------
Done
View / edit / reply to this conversation on ReviewNB
jdbcode commented on 2024-02-20T22:57:40Z ----------------------------------------------------------------
I don't think setting tileScale
is necessary here, unless I'm missing something. The example in this demo works with the default, but maybe tileScale
is needed for more broad use and application of this workflow?
jdbcode commented on 2024-03-13T21:10:38Z ----------------------------------------------------------------
Done
View / edit / reply to this conversation on ReviewNB
jdbcode commented on 2024-02-20T22:57:41Z ----------------------------------------------------------------
Casting GrainSize
as ee.Number
is unnecessary in this case.
jdbcode commented on 2024-03-13T21:11:02Z ----------------------------------------------------------------
Done
View / edit / reply to this conversation on ReviewNB
jdbcode commented on 2024-02-20T22:57:42Z ----------------------------------------------------------------
I think you can use ee.Geometry.coveringGrid to create this, which I think is more intuitive for readers. I.e. no need for this function, and in the next cell, I think the grid FeatureCollection can be defined as such:
Grid = watermask.reduceRegions( collection=AOI.coveringGrid(scale=Scale, proj='EPSG:4326'), reducer=ee.Reducer.mean()).filter(ee.Filter.neq('mean', None))
Done
View / edit / reply to this conversation on ReviewNB
jdbcode commented on 2024-02-20T22:57:42Z ----------------------------------------------------------------
Try to get line lengths close to 80 char
jdbcode commented on 2024-03-13T21:13:12Z ----------------------------------------------------------------
Done
View / edit / reply to this conversation on ReviewNB
jdbcode commented on 2024-02-20T22:57:43Z ----------------------------------------------------------------
Recommend not using \
for line continuation - how about:
images = ee.List.sequence( 0, ee.Number(numiter).multiply(4).subtract(1), 4).map( lambda x: results.get(x))
Done
View / edit / reply to this conversation on ReviewNB
jdbcode commented on 2024-02-20T22:57:44Z ----------------------------------------------------------------
Same note about avoding \
jdbcode commented on 2024-03-13T21:14:25Z ----------------------------------------------------------------
Done
View / edit / reply to this conversation on ReviewNB
jdbcode commented on 2024-02-20T22:57:45Z ----------------------------------------------------------------
The graph looks so nice and you include the value label - so I think you should not also print importance in the for loop.
jdbcode commented on 2024-03-13T21:15:45Z ----------------------------------------------------------------
Done
@osgeokr you've done an amazing job! This is one of the best tutorials I reviewed and the analyses is really useful. Thank you!
I left some comments that are mostly nits about code formatting and style and a couple suggestions for alternative implementations. You should be able to see comments in context using the ReviewNB links above.
Common formatting and style nits:
The Black Python code formatter is good for line length fixing - there is a command line version (I don't think it works on notebooks though), but there is a UI for it that is nice for copy/paste as few blocks of code: https://black.vercel.app/ (access the settings in the lower left to change line length to 80 char - doesn't have to be exactly, but when we publish on DevSite, 80 char fits without overflow scroll)
Please address the comments or reply to them for discussion or clarification. Once all the comments are addressed, please commit your changes and I'll look again.
Thanks, Justin
Thank you sincerely for your meticulous review! Working on the tutorial has enhanced my understanding of GEE, for which I am grateful. I have quickly gone through all the reviews you provided and have no further objections, so I will proceed to revise and commit the changes accordingly. I believe it will be possible within this week.
I have committed the updated file with the modifications to the comments you provided. Thanks a lot!
@osgeokr - thank you for the updates! I should be able to look in the next few days.
@osgeokr, thank you for the edits! Everything looks great - nice job! Next, the files will be pulled into Google and the page will be built and hosted on DevSite. It might be another week before it is live. I'll post the link in this PR when the page is finally published.
@jdbcode I am truly happy to play a small role in the Earth Engine Community! I sincerely appreciate all your help in this regard!
Congratulations, the page is live! Here is the link: https://developers.google.com/earth-engine/tutorials/community/species-distribution-modeling
You can also find it on the tutorial explorer page: https://developers.google.com/earth-engine/tutorials/community/explore#python_api_tutorials
And in the left navigation panel table of contents.
Thank you so much for the excellent tutorial and supporting the Earth Engine developer community!
Please let me know if you see any issues, you can also make any changes with another pull request. One thing I noticed is that the page building procedure did not generate static images from the geemap outputs. For instance, you can see them in this tutorial (https://developers.google.com/earth-engine/tutorials/community/imad-tutorial-pt1). I'll try to figure out what is going wrong.
I have completed writing the tutorial "Species Distribution Modeling with Google Earth Engine" previously accepted in #776.