-
Notifications
You must be signed in to change notification settings - Fork 1
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
99 select layer #167
99 select layer #167
Conversation
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #167 +/- ##
=======================================
Coverage 97.78% 97.79%
=======================================
Files 14 14
Lines 1174 1179 +5
=======================================
+ Hits 1148 1153 +5
Misses 26 26
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.
Thanks for putting these changes together - they LGTM.
I've made 2 small tweaks:
- Swapped
sel()
call afterclip()
during file opening - selecting the band after clipping gave a better performance when reading in data, without impacting the data being read in (commit a7e3cd4). - Merged with
dev
and updated the_xds.shape
size check to use_check_iter_length()
now that those updates were available indev
(commits 32155a2 and 287b6b6).
I've reviewed the new feature and all seems to be working as expected. The additions/changes to the unit tests reflect well the new band selection functionalities added to the RasterPop
class. All unit tests pass with no new warnings, and the coverage related to these additions is 100%.
I'm happy to merge this. It's brings the population
module nicely in line with urban_centres
now that a band can be selected. Thanks again!
* feat: added band option to _read_and_clip * fix: removed squeeze as does not work with 2x2 xarrray * feat: added defences for band argument * test: remove added extra dimension from xarr_1_aoi fixture * fix: small change to docstring in tests * tests: added tests to check band argument behaviour * fix: added centre_crs argument to urban centre call * fix: clip then sel after opening * feat: use _check_iter_length on _xds.shape --------- Co-authored-by: Ethan Moss <[email protected]> 6f9ed81
Description
transport_peformance.population.rasterpop
.Fixes #99
Motivation and Context
GHSL raster files only include a single band. However, if using different data sources, a functionality may be needed to select a specific band when loading the data (e.g. cases where the population data is in a band other than the first).
Type of change
How Has This Been Tested?
xarray
sel
method.e2e.py
notebook to ensure pipeline works.Test configuration details:
Advice for reviewer
Checklist:
Additional comments
Made three small changes unrelated to the issue:
test_rasterpop_get_pop_raises
docstring (get_data()
->get_pop()
).test_plot_folium_no_uc
function name.centre_crs
argument to urban centre module call ine2e.py
notebook.