Closed mponce0 closed 9 months ago
Hi @mponce0,
Thank you very much for pointing out this issue. Because of the sequential nature of the process, as the first function failed, all the other functions failed as well. The automatic selection of the country index in the "initiate_project" function in test mode was not consistent with the country used for testing (maybe due to different version of the "countrycode" dependency). I slightly modified the code to avoid this potential inconsistency.
Let me know if you still experience an error, and if not, would you please close this issue ?
Thanks again,
Best regards,
Pablo
Thanks this fixed most of the issues, however there is one test still failing in Linux systems: test #7
── Failed tests ───────────────────────────────────────────────────────────────────────────────────────────────────
Error (test-07-download_osm.R:6:3): test download_osm
Error in `check_exists(pathFolder, "raw", layer = TRUE)`: /tmp/RtmpAlQR50/Switzerland/data/vWaterlines does not exist. Run the initiate_project function first or check the input parameters.
Backtrace:
▆
1. ├─testthat::expect_equal(...) at test-07-download_osm.R:6:3
2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
3. │ └─rlang::eval_bare(expr, quo_get_env(quo))
4. └─inAccessMod::download_osm(...)
5. └─inAccessMod::check_exists(pathFolder, "raw", layer = TRUE) at inAccessMod/R/download_osm.R:61:3
[ FAIL 1 | WARN 0 | SKIP 0 | PASS 14 ]
Actually if you look into the data directory you will see the problem:
> system("ls /tmp/RtmpAlQR50/Switzerland/data/")
config.txt rDEM rPopulation vFacilities vRoads zToAccessMod
log.txt rLandcover vBorders vNaturalPolygons vWaterLines
The issue is that somehow the R code refers to "vWaterlines" (notice the lower case "l") vs the "vWaterLines" (capital case "L") in the directories names. BTW this does not happen in MacOS as it is not case sensitive, i.e. in MacOS all the tests cases are passing but not in case-sensitive OSes, such as, Linux.
Looking into your initiate_project.R
module, there are a couple of things that could fix this by switching to "vWaterlines", as well as, "vNaturalpolygons" (for similar reasons).
I just created a pull-request for you to review with the changes, which I believe will fix this issue.
Thanks a lot Marcelo.
As explained here https://github.com/unige-geohealth/inAccessMod/pull/6#issuecomment-1848641079, as we had the word "waterLines" in multiple places in the package (especially in code examples), we finally decided to modify the line in download_osm
that was causing the issue without the need of replacing "waterLines" by "waterlines" everywhere.
It might work now.
Best regards.
Sorry, but it is failing with the same error if I try the current version from the repository.
── Failed tests ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Error (test-07-download_osm.R:6:3): test download_osm
Error in `check_exists(pathFolder, "raw", layer = TRUE)`: /tmp/Rtmp344lKk/Switzerland/data/vWaterlines does not exist. Run the initiate_project function first orcheck the input parameters.
Backtrace:
▆
1. ├─testthat::expect_equal(...) at test-07-download_osm.R:6:3
2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
3. │ └─rlang::eval_bare(expr, quo_get_env(quo))
4. └─inAccessMod::download_osm(...)
5. └─inAccessMod::check_exists(pathFolder, "raw", layer = TRUE) at inAccessMod/R/download_osm.R:61:3
[ FAIL 1 | WARN 0 | SKIP 0 | PASS 14 ]
and data directory appears to be unchanged in terms of sub-directories names"
> system('ls /tmp/Rtmp344lKk/Switzerland/data')
config.txt log.txt rDEM rLandcover rPopulation vBorders vFacilities vNaturalPolygons vRoads vWaterLines zToAccessMod
@mponce0 You are right, I committed the changes but I forgot to push them, my bad. Could you try again ?
Sorry for that, and thank you very much !
Tests are passing both in Linux and MacOS! Thank you for looking into this, will close this issue.
I've found another issue though, I will open a separate issue for it.
The "Automated Tests Cases" are failing. See details below,
Details about the R environment,
https://github.com/openjournals/joss-reviews/issues/5879