Closed micha-silver closed 3 weeks ago
@obrl-soil, as already agreed, please take some extra time with your field work and the holidays coming up. I’ll follow up mid-late January if I don’t hear back from you by then.
Hi @micha-silver , I'm looking forward to working with you on this review. As mentioned by adamhsparks I am on leave until mid-Jan so won't have much time to meaningfully contribute before then.
I've just been having a superficial look and thought I would share some thoughts:
This package uses the R package for acquiring Sentinel-2 imagery. To install that package...
Could be made more clear using curly bracket convention to show R packages eg.
{rOPTRAM} uses {sen2r} for acquiring Sentinel-2 imagery. To install {sen2r}...
Hi @harryeslick :
Thanks for the early comments. I'll have a look at replacing the references to external packages, as you suggested.
Regarding {sen2r}, indeed the maintainer has gone to other things, and what's worse, part of his earlier implementation (accessing the Copernicus API) no longer works since the API has been changed. We are now actively working on alternatives. This will probably include the new {CDSE} package, now on CRAN, that offers access thru the new Copernicus API. I'd like to go ahead with the review process looking at the package as is, currently. If it's accepted to ROpenSci, then we'll move on to a second version once we have implemented and tested the image acquisition changes.
Looking forward to further responses ... next year. Happy holidays.
Regards, Micha
:calendar: @harryeslick you have 2 days left before the due date for your review (2023-12-29).
:calendar: @obrl-soil you have 2 days left before the due date for your review (2023-12-29).
I think that it's necessary to remove any dependencies on a package that is no longer supported, i.e., {sen2r}. Please make the necessary changes to ensure that {rOPTRAM} will work as anticipated by users before we accept it into rOpenSci so that the reviewers may review the package as it will be used. We can place a hold on the reviews if necessary for these changes to be made.
Just by way of information, I had a situation with {nasapower} where the NASA team actually implemented a proper API while I had the original version of the package in-review, we waited to finalise the review until I basically rewrote the entire package due to the changes with the data source. This is much more minor than that was.
OK, so I understand the review is on "freeze" until I remove the deprecated {sen2r}, and implement the new API. We're now working on the replacements for {sen2r}, so the complete package should be ready "soon...".
@ropensci-review-bot put on hold
Submission on hold!
@harryeslick and @obrl-soil, I've placed a "Holding" label on this review; please hold off on your reviews until the appropriate changes have been made to the package. If you are unable to complete your reviews at a later date just ping me and I'll get it sorted.
Hello @adamhsparks I'm happy to inform that we've completed removal of the deprecated {sen2r} package, and replaced it with the new {CDSE} package for access to Sentinel imagery. We also added additional vignettes, as well as two new curve fitting options to create the OPTRAM 'trapezoid'. Today I ran the CI pipeline, and all tests passed on the gitlab installation (ubuntu release). Coverage is at 87.9%. I also request tests, from the CI pipeline using rhub on Windows and Mac, and these are failing since a few tests require login credentials. (I don't yet know how to send the creds to rhub. I'll check how to use environment variables...)
On Ubuntu release:
── R CMD check results ────────────────────────────────── rOPTRAM 0.1.0.000
Duration: 1m 35.8s
❯ checking installed package size ... NOTE
installed size is 8.1Mb
sub-directories of 1Mb or more:
doc 2.2Mb
extdata 5.6Mb
0 errors ✔ | 0 warnings ✔ | 1 note ✖
rOPTRAM Coverage: 87.96%
Other platforms:
ℹ Check
<https://mac.r-project.org/macbuilder/results/1709624544-1d521aff36a481d0/>
the results in 5-10 mins (~07:52 AM).
platform errors warnings notes
windows-x86_64-release 1 0 1
windows-x86_64-oldrel 0 0 0
windows-x86_64-devel 1 0 1
macos_release 6 4 18
[1] "2024-03-05 07:52:26.288169 - Check completed"
[1] "Elapsed time for checking: 24.1 minutes"
Error: Some checks with ERROR, or WARNING.
Execution halted
Please consider releasing the hold, and approaching reviewers to begin their review of the package. Thanks,
@ropensci-review-bot remove hold
I'm sorry human, I don't understand that. You can see what commands I support by typing:
@ropensci-review-bot help
@ropensci-review-bot help
Hello @adamhsparks, here are the things you can ask me to do:
# Add a review's info to the ROpenSci logs
@ropensci-review-bot submit review <REVIEW_URL> time <REVIEW_HOURS(ex. 10.5)>
# List all available commands
@ropensci-review-bot help
# Show our Code of Conduct
@ropensci-review-bot code of conduct
# Checks peer-review badge is in README.md
@ropensci-review-bot check readme
# Switch to 'seeking reviewers'
@ropensci-review-bot seeking reviewers
# Approves a package. This command will close the issue.
@ropensci-review-bot approve package-name
# Invite the author of a package to the corresponding rOpenSci team. This command should be issued by the author of the package.
@ropensci-review-bot invite me to ropensci/package-name
# Adds package's repo to the rOpenSci team. This command should be issued after approval and transfer of the package.
@ropensci-review-bot finalize transfer of package-name
# Mint package as [bronze/silver/gold]
@ropensci-review-bot mint silver
# Add a user to this issue's reviewers list
@ropensci-review-bot assign xxxxx as reviewer
# Remove a user from the reviewers list
@ropensci-review-bot remove xxxxx from reviewers
# Assign a user as the editor of this submission
@ropensci-review-bot assign @username as editor
# Put the submission on hold for the next 90 days
@ropensci-review-bot put on hold
# Remove the editor assigned to this submission
@ropensci-review-bot remove editor
# Change or add a review's due date for a reviewer
@ropensci-review-bot set due date for @reviewer to YYYY-MM-DD
# Close the issue
@ropensci-review-bot out of scope
# Various package checks
@ropensci-review-bot check package
# Checks srr documentation for stats packages
@ropensci-review-bot check srr
Update:
I added a skip_if_not
to avoid the test for the credentials when the creds file is not available. So now the Windows builds go thru cleanly. But MacOS still not :-(
@harryeslick and @obrl-soil, sorry for the delay. I'll set the due date to three weeks from now. If you need more time, feel free to take it, please just let us know you need more time.
@ropensci-review-bot set due date for @harryeslick to 2024-03-25
I'm sorry human, I don't understand that. You can see what commands I support by typing:
@ropensci-review-bot help
@ropensci-review-bot set due date for @harryeslick to 2024-03-25
Review due date for @harryeslick is now 25-March-2024
@ropensci-review-bot set due date for @obrl-soil to 2024-03-25
Review due date for @obrl-soil is now 25-March-2024
Hi @adamhsparks Just a quick update: we've fixed the final two (minor) issues with the MacOS build. Now I'm getting no errors and no warnings on all 5 platforms. And coverage is at 92% :-)
Hi @adamhsparks No response yet from either of the reviewers. Is it time for a gentle reminder?
Hey - sorry but the rewrite pushed this from a quiet time for me to a very busy one! I can get to this over the long weekend.
Hi @micha-silver ,
Im working my way through.
I've logged an issue for you in GitLab: rsl-bidr/roptram#1
@harryeslick
Thanks for finding time for the review.
This issue is fixed in the gitlab repo: 99c04bff.
I improved the check_swir_band function, and also changed the example.
@micha-silver , here is my review, For the most part it all works quite easily, so well done! my comments as all minor things.
I still need to read up on the Packaging guidelines
so Ive not quite completed it yet, so some jobs for me to follow up on as well.
Please check off boxes as applicable, and elaborate in comments below. Your review is not limited to these topics, as described in the reviewer guide
The package includes all the following forms of documentation:
some minor suggestions:
Running the main wrapper function optram()
in the example states that
Registration on Copernicus DataSpace was done in advance, and the OAuth credentials (clientid, and secret) have been saved to the user’s home directory.
I would i like to have a link here to the vignette where setting up OAuth is demonstrated.
This is a bit of a stylistic preference, and keep in mind I don't fully understand the workflow, so I could be totally wrong here...
roptram/docs/articles/rOPTRAM_acquiring.html#step-4-saving-credentials
Saving credentials section seems a little long winded and unnecessary. I think it could probably be replaced with just
store_cdse_credentials("my_clientID", "My_secret")
the convenience of having a save_creds = TRUE,
seems to require more time to explain that it saves in the actual workflow. but I could be wrong.
[x] Vignette(s): demonstrating major functionality that runs successfully locally
[x] Function Documentation: for all exported functions
main page references function optram_soil_moisture()
roptram/docs/index.html#optram_soil_moisture
Is this meant to be optram_calculate_soil_moisture()
?
ALSO: optram_calculate_soil_moisture
fails with default trapezoid_method
trapezoid_method
is called (Line92) before arg.match(trapezoid_method)
(Line108)
[x] Examples: (that run successfully locally) for all exported functions
I found a few minor bugs here:
acquire_scihub(aoi, from_date, to_date, veg_index = "SAVI")
returns error
SWIR band must be either 11 or 12
optram_acquire_s2
remote = "scihub"
SWIR_Band
default fails:
optram_calculate_soil_moisture
system.file
call missing package parameter.
should be data_dir <- system.file("extdata", package = "rOPTRAM")
optram_calculate_str
returns NULL
data_dir system.file
call missing package parameter.
should be: BOA_dir <- system.file("extdata", "BOA", package = "rOPTRAM")
optram_ndvi_str
returns NULL
VI_list system.file
call missing package parameter. Also using SAVI
instead of NDVI
STR_list system.file
call missing package parameter.
optram_wetdry_coefficients
Please check example here. not sure if the plot works...
plot_vi_str_cloud
Please check example here. not sure if the plot works...
retrieve_cdse_credentials
No example provided, but not sure if one is required.
Does this function need to be exported?
store_cdse_credentials
No example provided
URL
, BugReports
and Maintainer
(which may be autogenerated via Authors@R
).Estimated hours spent reviewing: 6
rOPTRAM::optram
default argument SWIR_band
is invalidissue related to default parameter values logged as issue here: https://gitlab.com/rsl-bidr/roptram/-/issues/1
credentials bug logged : https://gitlab.com/rsl-bidr/roptram/-/issues/2
@harryeslick With the latest commit we have (I think) addressed all the suggestions that you raised. Any further comments are welcome! (How can I get your email addr to add you as 'rev' to the DESCRIPTION file?)
Hey, sorry this took so long! Not sure I caught everything but I think I've covered off on the main issues. Tl;dr, good job overall but I think the function design is trying to do a little too much for the end user in places.
The package includes all the following forms of documentation:
[x] A statement of need: clearly stating problems the software is designed to solve and its target audience in README
[x] Installation instructions: for the development version of package and any non-standard dependencies in README
[x] Vignette(s): demonstrating major functionality that runs successfully locally
[x] Function Documentation: for all exported functions
[ ] Examples: (that run successfully locally) for all exported functions
[x] Community guidelines: including contribution guidelines in the README or CONTRIBUTING, and DESCRIPTION with URL
, BugReports
and Maintainer
(which may be autogenerated via Authors@R
).
[ ] Packaging guidelines: The package conforms to the rOpenSci packaging guidelines.
Estimated hours spent reviewing: 8
plot_vi_str_cloud()
should be calling ggsave()
; let the user do that (you can demonstrate in an example) or at the very least make it optional. Depending on what the user wants to do with the graphic they'll likely want more control over dimensions, DPI, etc. Also, the way its written this function never sends a plot to the graphics device - the outputs can't be viewed in RStudio at all. This is, I think, not generally expected when plot()
is called.aoi_file
parameter here. It creates a lot of room for weird errors which you'll then be pestered about. Instead, I think it would be far safer to require the user to read in a file using sf
and supply the resultant object to aoi_file
. This then gives you the ability to write unit tests and error catches to cover e.g. correct spatial type supplied, data projected in an acceptable CRS, non-insane extents, etc. You can't do any of that when all you have to work with is a file path string.remotes::install_gitlab()
does not build vignettes by default. You may wish to specify installation with build_vignettes = TRUE
in your README to prevent confusion.knitr::include_graphics()
calls in Vignette "rOPTRAM: Three Trapezoid Fitting Methods" are failing with a 'can't find file' error - might be related to installing from gitlab though.Documentation is good (I especially like how you've specified the data types for each arg) but would benefit from some finessing, namely:
see https://roxygen2.r-lib.org/articles/formatting.html .
For specific functions,
aquire_scihub()
note
for aquire_scihub()
seem to be out of date; I think the website has been updated. I had to do the following:
exponential_coefficients()
optram_landsat()
optram_wetdry_coefficients()
rOPTRAM:::
syntax to work correctlylandsat_dir
parameter should all explain what's going on there, currently only optram_landsat()
doesaquire_openeo()
acq <- aquire_openeo()...
otherwise the list of files just gets reported to the console and is otherwise impossible to retrieve without re-running the code.aquire_scihub()
aquire_openeo()
the SWIR band needs to be specified or checked differently.acq_sh <- acquire_scihub(aoi, from_date, to_date,
veg_index = "SAVI",
clientid = 'paste id here',
secret = 'paste secret here',
SWIR_band = 11)
to prompt the user directly.
acquire_openeo()
and didn't report any errors to the console. I see it masks the output to the AOI polygon without being prompted too - is that a desirable/possible option for acquire_openeo()
?calculate_vi()
crop_landsat_list()
exponential_soil_moisture()
, linear_soil_moisture()
, optram_calculate_soil_moisture()
data_dir =
might need editing?optram_acquire_s2()
remote = "scihub"
in final commandoptram_calculate_str()
optram_ndvi_str()
VI_list
returns NULLoptram_prepare_other_vi_str()
print()
command referencing a nonexistent R source file should not be here. This example should be rewritten or removed.polynomial_coefficients()
store_cdse_credentials()
test-aquire_s2.R
, I don't think that test 'AOI file is not spatial' is doing what it claims to. As discussed, given that your functions point to on-disk files rather than making the user read the data in first, I think the closest you could get here is running a mime-type check on the file extension. Hi @obrl-soil Thanks for the detailed review! We'll start going over, point by point, and let you know when everything has been addressed. (Can you send me your email, so that I can add you as 'rev' in the DESCRIPTION file?)
@adamhsparks , @obrl-soil , @harryeslick : In @obrl-soil 's review, she raises an interesting point:
"I don't think your functions should be reading spatial data in for the users, and I'm specifically focusing on the aoi_file parameter here. It creates a lot of room for weird errors which you'll then be pestered about. Instead, I think it would be far safer to require the user to read in a file using sf and supply the resultant object to aoi_file. This then gives you the ability to write unit tests and error catches to cover e.g. correct spatial type supplied, data projected in an acceptable CRS, non-insane extents, etc. You can't do any of that when all you have to work with is a file path string."
I chose to allow users to enter a file name for the area of interest, instead of requiring them to read their spatial file as an sf
object, and passing that thru to the various functions. This choice was for two reasons: I use the file name (without file extension) later to add a title to the derived scatter plot. And second, I do not assume users would necessarily have knowledge of the {sf} package. However @obrl-soil suggests not to save the scatterplot to an image file at all, rather let the user do that by herself. So the first reason above would be canceled, leaving only the second reason: user's handling of {sf} objects by herself.
I'd like to ask your opinions if it's reasonable to expect user's to understand the {sf} package well enough to read in their aoi_file
, and pass an sf
object to the OPTRAM functions. (This would certainly save some complexity in the rOPTRAM package)
Thanks,
I agree with @obrl-soil on this. Too many edge cases. Users can be expected to have a modest understanding of {sf} to use a package that leverages it. Simplify your package. Future you will thank you.
In the past I added “support” for operations outside the focus of my package, in time I simplified following the UNIX philosophy. Do one thing. Do it well. No one ever complained about the “loss” of functionality as it was already in R with other packages.
I forgot to do this.
@ropensci-review-bot submit review https://github.com/ropensci/software-review/issues/612#issuecomment-2027336215 time 6
Logged review for harryeslick (hours: 6)
@ropensci-review-bot submit review https://github.com/ropensci/software-review/issues/612#issuecomment-2053591926 time 8
Logged review for obrl-soil (hours: 8)
Hello all: First a big thanks to the reviewers for their insightful comments. :clap: :clap: We have gone over the list and modified as follows:
sf
object;Looking forward to any additional suggestions.
Also... I'm looking for advice on one issue:
We implement two functions for building the model from pre-downloaded Landsat, or Sentinel imagery. Users who choose to download manually can build the module using optram_safe()
on a directory of *SAFE
folders, and optram_landat()
with a directory of Landsat folders. I do not see any way to show examples, or write tests since both of these require many GB of imagery as input - way too much for a github repo.
How should I present this? Currently, in the examples, I sidestep the problem and put:
#' \dontrun{
#' aoi <- sf::st_read(system.file("extdata",
#' "lachish.gpkg", package = "rOPTRAM"))
#' # landsat_dir is a directory containing the original downloaded Landsat images.
#' landsat_dir <- "...enter full path here..."
#' optram_landsat(landsat_dir, aoi,
#' veg_index = 'SAVI',
#' LC_output_dir = tempdir(), data_output_dir = tempdir())
#' }
@ropensci-review-bot submit response https://github.com/ropensci/software-review/issues/612#issuecomment-2084811325
I'm sorry @adamhsparks, I'm afraid I can't do that. That's something only author1 and author-others are allowed to do.
Thanks, @micha-silver, @obrl-soil and @harryeslick, can you please check if you are satisfied with the changes and if you have additional comments?
Also... I'm looking for advice on one issue: We implement two functions for building the model from pre-downloaded Landsat, or Sentinel imagery. Users who choose to download manually can build the module using
optram_safe()
on a directory of*SAFE
folders, andoptram_landat()
with a directory of Landsat folders. I do not see any way to show examples, or write tests since both of these require many GB of imagery as input - way too much for a github repo. How should I present this? Currently, in the examples, I sidestep the problem and put:#' \dontrun{ #' aoi <- sf::st_read(system.file("extdata", #' "lachish.gpkg", package = "rOPTRAM")) #' # landsat_dir is a directory containing the original downloaded Landsat images. #' landsat_dir <- "...enter full path here..." #' optram_landsat(landsat_dir, aoi, #' veg_index = 'SAVI', #' LC_output_dir = tempdir(), data_output_dir = tempdir()) #' }
This is how I would handle the example.
Do the data requirements expand beyond the need to download the data? That is, once the data is downloaded, is the pathway for the model the same and is therefore tested with the normal tests?
This is how I would handle the example.
Do the data requirements expand beyond the need to download the data? That is, once the data is downloaded, is the pathway for the model the same and is therefore tested with the normal tests?
Yes, that's exactly what happens.
I'd not worry about tests for this then.
@micha-silver, @github_handle1, @github_handle2: please post your response with @ropensci-review-bot submit response <url to issue comment>
if you haven't done so already (this is an automatic reminder).
Here's the author guide for response. https://devguide.ropensci.org/authors-guide.html
@ropensci-review-bot submit response https://github.com/ropensci/software-review/issues/612#issuecomment-2084811325
Logged author response!
Date accepted: 2024-06-05
Submitting Author Name: Micha Silver Submitting Author Github Handle: !--author1-->@micha-silver<!--end-author1-- Other Package Authors Github handles: (comma separated, delete if none) @github_handle1, @github_handle2 Repository: https://gitlab.com/rsl-bidr/roptram Version submitted: 0.0.1.000 Submission type: Standard Editor: !--editor-->@adamhsparks<!--end-editor-- Reviewers: @harryeslick, @obrl-soil
Archive: TBD Version accepted: TBD Language: en
Scope
Please indicate which category or categories from our package fit policies this package falls under: (Please check an appropriate box below. If you are unsure, we suggest you make a pre-submission inquiry.):
Explain how and why the package falls under these categories (briefly, 1-2 sentences): This package includes acquiring satellite imagery, and preparing spatially explicit soil moisture raster grids.
Who is the target audience and what are scientific applications of this package? Researchers in ecology, agriculture, sustainability. Agricultural management of grazing lands, reforestration.
Are there other R packages that accomplish the same thing? If so, how does yours differ or meet our criteria for best-in-category? No
(If applicable) Does your package comply with our guidance around Ethics, Data Privacy and Human Subjects Research? Yes
If you made a pre-submission inquiry, please paste the link to the corresponding issue, forum post, or other discussion, or @tag the editor you contacted.
Explain reasons for any
pkgcheck
items which your package is unable to pass.Technical checks
Confirm each of the following by checking the box.
This package:
Publication options
[ ] Do you intend for this package to go on CRAN?
[ ] Do you intend for this package to go on Bioconductor?
[x] Do you wish to submit an Applications Article about your package to Methods in Ecology and Evolution? If so:
MEE Options
- [ ] The package is novel and will be of interest to the broad readership of the journal. - [ ] The manuscript describing the package is no longer than 3000 words. - [ ] You intend to archive the code for the package in a long-term repository which meets the requirements of the journal (see [MEE's Policy on Publishing Code](http://besjournals.onlinelibrary.wiley.com/hub/journal/10.1111/(ISSN)2041-210X/journal-resources/policy-on-publishing-code.html)) - (*Scope: Do consider MEE's [Aims and Scope](http://besjournals.onlinelibrary.wiley.com/hub/journal/10.1111/(ISSN)2041-210X/aims-and-scope/read-full-aims-and-scope.html) for your manuscript. We make no guarantee that your manuscript will be within MEE scope.*) - (*Although not required, we strongly recommend having a full manuscript prepared when you submit here.*) - (*Please do not submit your package separately to Methods in Ecology and Evolution*)Code of conduct