-
Notifications
You must be signed in to change notification settings - Fork 149
Feature/coverage nightlight #659
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
1) Add tests for functions:
- load_nasa_nl_shape_single_tile
- load_nightlight_noaa
- untar_noaa_stable_nighlight
2) Add raises message if wrong layer is selected in function:
load_nasa_nl_shape_single_tile
3 ) Add logger message in function: load_nasa_nl_shape_single_tile
4) Correct test unzip_tif_to_py
5) Apply uniform formatting across all tests of nightlight.py module
1) line too long 2 )use %s for logging instead of f-strings
Add small test for function load_gpw_pop_shape() situated in: climada/entity/exposures/litpop/gpw_population.py
Add test for functions: 1) from_nightlight_intensity() 2) from_population()
|
Hi @NicolasColombi, I still have two comments: (2) there are still some functions that are not tested (load_nasa_nl_shape, get_required_nl_files, check_nl_local_file_exists, load_nightlight_nasa) But again, the second point is only a suggestion, for the first please quickly check that it is fine that a test downloads data. Thanks a lot for your work |
Hi @samluethi, Thank you for the review and the comments! Regarding point 1) What you say is very true, and it applies to unittest (test which are runned everytime a commit is pushed). Even though we haven’t adopted a clear definition yet for unit and integration tests, the idea is that unittests shouldn't call any other climada function (except the one they are testing), should only use small mock data and should be fast. Regarding point 2) Thanks for pointing that out, I will try to finish the tests of nightlight.py so that the class will be all tested. I will let you know when I will be done with the changes ;) Cheers |
|
Thanks a lot @NicolasColombi ;) |
Add test for function climada/entity/exposures/litpop/nightlight.py get_required_nl_files() remove unnecessary brackets from nightlight.py
2 BM_FILES in local data folder downloaded with climada but 5 BM_FILES on the system dir of jenkins
Changes proposed in this PR:
Add coverage tests for
climada/entity/exposures/litpop/nightlight.pyFor nightlight:
-
load_nasa_nl_shape_single_tile-
load_nightlight_noaa-
untar_noaa_stable_nighlight-
get_required_nl_files-
check_nl_local_file existload_nasa_nl_shape_single_tileload_nasa_nl_shape_single_tiletest_unzip_tif_to_pynightlight.pymoduleFor litpop:
-
from_nightlight_intensity-
from_populationPR Author Checklist
develop)PR Reviewer Checklist