ropensci / software-review

rOpenSci Software Peer Review.
294 stars 104 forks source link

rgeeExtra: An extensions for 'rgee' #608

Open csaybar opened 1 year ago

csaybar commented 1 year ago

Submitting Author Name: Cesar Aybar Submitting Author Github Handle: !--author1-->@csaybar<!--end-author1-- Other Package Authors Github handles: (comma separated, delete if none) @davemlz, @LBautistaB13, @choisy Repository: https://github.com/r-earthengine/rgeeExtra Version submitted: 0.0.1 Submission type: Standard Editor: !--editor-->@maurolepore<!--end-editor-- Reviewers: @nmorandeira, @zackarno

Archive: TBD Version accepted: TBD Language: en


Package: rgeeExtra
Title: Extensions for 'rgee'
Version: 0.0.1
Authors@R: 
    c(person(given = "Cesar",
           family = "Aybar",
           role = c("aut", "cre"),
           email = "csaybar@gmail.com",
           comment = c(ORCID = "0000-0003-2745-9535")),
      person(given = "David",
           family = "Montero",
             role = c("ctb"),
             email = "dml.mont@gmail.com",
             comment = c(ORCID = "0000-0002-9010-3286")),
      person(given = "Lesly",
           family = "Bautista",
             role = c("ctb"),
             email = "leslyarcelly.213@gmail.com",
             comment = c(ORCID = "0000-0003-3523-8687")),
      person(given = "Marc",
           family = "Choisy",
             role = c("ctb"),
             email = "mchoisy@oucru.org",
             comment = c(ORCID = "0000-0002-5187-6390"))
    )
Description: High-level API to process Google Earth Engine (GEE) raster (ee.Image and ee.ImageCollection) and vector data (ee.Geometry, ee.Feature, and ee.FeatureCollection). Popular Third-party GEE algorithms are re-coded from Javascript and Python to R.
License: Apache License (>= 2)
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
Config/reticulate:
  list(
    packages = list(
      list(package = "earthengine-api")
    )
  )
Imports:
    reticulate (>= 1.31),
    rgee,
    magrittr,
    crayon,
    cli
Suggests:
    testthat (>= 3.0.0),
    googledrive,
    googleCloudStorageR,
    geojsonio,
    magick,
    stars,
    sf,
    knitr,
    rmarkdown
VignetteBuilder: knitr
Language: en-US
BugReports: https://github.com/r-earthengine/rgeeExtra/issues
URL: https://github.com/r-earthengine/rgeeExtra

Scope

rgeeExtra is an extension of the rgee package that enables interaction with Google Earth Engine (GEE). The advantage of rgeeExtra lies in its user-friendly syntax for R users. The package includes operator overloading and access to various functions created by third parties within the ee_extra package.

GEE users and any R user who wants to retrieve data using the GEE API from within R.

There are other packages for connecting to GEE, but they are primarily focused on composite generation and data download. See geedim

Yes

Technical checks

Confirm each of the following by checking the box.

This package:

Publication options

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

ropensci-review-bot commented 1 year ago

Thanks for submitting to rOpenSci, our editors and @ropensci-review-bot will reply soon. Type @ropensci-review-bot help for help.

ropensci-review-bot commented 1 year ago

:rocket:

Editor check started

:wave:

ropensci-review-bot commented 1 year ago

Checks for rgeeExtra (v0.0.1)

git hash: 79fde841

Important: All failing checks above must be addressed prior to proceeding

Package License: Apache License (>= 2)


1. Package Dependencies

Details of Package Dependency Usage (click to open)

The table below tallies all function calls to all packages ('ncalls'), both internal (r-base + recommended, along with the package itself), and external (imported and suggested packages). 'NA' values indicate packages to which no identified calls to R functions could be found. Note that these results are generated by an automated code-tagging system which may not be entirely accurate. |type |package | ncalls| |:----------|:-------------------|------:| |internal |base | 71| |internal |rgeeExtra | 38| |internal |graphics | 5| |internal |stats | 2| |imports |magrittr | 70| |imports |rgee | 29| |imports |reticulate | 5| |imports |crayon | NA| |imports |cli | NA| |suggests |sf | 2| |suggests |magick | 1| |suggests |testthat | NA| |suggests |googledrive | NA| |suggests |googleCloudStorageR | NA| |suggests |geojsonio | NA| |suggests |stars | NA| |suggests |knitr | NA| |suggests |rmarkdown | NA| |linking_to |NA | NA| Click below for tallies of functions used in each package. Locations of each call within this package may be generated locally by running 's <- pkgstats::pkgstats()', and examining the 'external_calls' table.

base

c (13), list (12), length (9), drop (6), for (4), lapply (3), which (3), mode (2), names (2), seq_along (2), sprintf (2), all (1), args (1), basename (1), diff (1), dirname (1), gsub (1), rep (1), scale (1), source (1), system.file (1), tempfile (1), try (1), url (1)

magrittr

%>% (70)

rgeeExtra

ee_get (3), ee_connect_to_py (2), ee_new_list_name (2), ee_source_python (2), ee_check_packages (1), ee_image_getCitation (1), ee_image_getDOI (1), ee_Image_getOffsetParams (1), ee_Image_getScaleParams (1), ee_Image_getSTAC (1), ee_Image_maskClouds (1), ee_Image_matchHistogram (1), ee_Image_panSharpen (1), ee_Image_preprocess (1), ee_Image_scaleAndOffset (1), ee_Image_spectralIndex (1), ee_Image_tasseledCap (1), ee_ImageCollection_closest (1), ee_ImageCollection_getCitation (1), ee_ImageCollection_getDOI (1), ee_ImageCollection_getOffsetParams (1), ee_ImageCollection_getScaleParams (1), ee_ImageCollection_getSTAC (1), ee_ImageCollection_panSharpen (1), ee_ImageCollection_preprocess (1), ee_ImageCollection_scaleAndOffset (1), ee_ImageCollection_spectralIndex (1), ee_ImageCollection_tasseledCap (1), ee_maxValue (1), ee_minValue (1), Math.ee.image.Image (1), Ops.ee.image.Image (1), Summary.ee.image.Image (1)

rgee

ee_as_sf (4), sf_as_ee (4), ee$ImageCollection (3), ee$ImageCollection$first (2), ee$ImageCollection$toList (2), ee$List$get (2), ee$Reducer$max (2), ee$Image (1), ee$Image$abs (1), ee$Image$bandNames (1), ee$Image$pow (1), ee$Image$unmask (1), ee$ImageCollection$getVideoThumbURL (1), ee$List$length (1), ee$List$sequence (1), ee$Number$format (1), ee$Reducer$min (1)

graphics

image (5)

reticulate

import_from_path (4), py_discover_config (1)

sf

st_cast (2)

stats

offset (2)

magick

image_read (1)

**NOTE:** Some imported packages appear to have no associated function calls; please ensure with author that these 'Imports' are listed appropriately.


2. Statistical Properties

This package features some noteworthy statistical properties which may need to be clarified by a handling editor prior to progressing.

Details of statistical properties (click to open)

The package has: - code in R (100% in 12 files) and - 1 authors - 2 vignettes - no internal data file - 5 imported packages - 48 exported functions (median 4 lines of code) - 60 non-exported functions in R (median 8 lines of code) --- Statistical properties of package structure as distributional percentiles in relation to all current CRAN packages The following terminology is used: - `loc` = "Lines of Code" - `fn` = "function" - `exp`/`not_exp` = exported / not exported All parameters are explained as tooltips in the locally-rendered HTML version of this report generated by [the `checks_to_markdown()` function](https://docs.ropensci.org/pkgcheck/reference/checks_to_markdown.html) The final measure (`fn_call_network_size`) is the total number of calls between functions (in R), or more abstract relationships between code objects in other languages. Values are flagged as "noteworthy" when they lie in the upper or lower 5th percentile. |measure | value| percentile|noteworthy | |:------------------------|-----:|----------:|:----------| |files_R | 12| 65.5| | |files_vignettes | 2| 85.7| | |files_tests | 9| 89.6| | |loc_R | 825| 62.7| | |loc_vignettes | 120| 31.3| | |loc_tests | 477| 74.0| | |num_vignettes | 2| 89.2| | |n_fns_r | 108| 78.4| | |n_fns_r_exported | 48| 87.1| | |n_fns_r_not_exported | 60| 72.4| | |n_fns_per_file_r | 6| 75.7| | |num_params_per_fn | 2| 11.9| | |loc_per_fn_r | 5| 8.1| | |loc_per_fn_r_exp | 4| 7.0| | |loc_per_fn_r_not_exp | 8| 22.6| | |rel_whitespace_R | 15| 58.6| | |rel_whitespace_vignettes | 50| 45.3| | |rel_whitespace_tests | 31| 80.2| | |doclines_per_fn_exp | 37| 45.3| | |doclines_per_fn_not_exp | 0| 0.0|TRUE | |fn_call_network_size | 13| 37.5| | ---

2a. Network visualisation

Click to see the interactive network visualisation of calls between objects in package


3. goodpractice and other checks

Details of goodpractice checks (click to open)

#### 3a. Continuous Integration Badges [![R-CMD-check.yaml](https://github.com/r-earthengine/rgeeExtra/actions/workflows/R-CMD-check.yaml"> ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-subsetting.R:6:0 2. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) [ FAIL 8 | WARN 0 | SKIP 0 | PASS 0 ] Error: Test failures Execution halted R CMD check generated the following note: 1. checking installed package size ... NOTE installed size is 6.1Mb sub-directories of 1Mb or more: doc 4.3Mb ee_extra 1.6Mb R CMD check generated the following test_fail: 1. > library(testthat) > library(rgee) > library(rgeeExtra) > library(stars) Loading required package: abind Loading required package: sf Linking to GEOS 3.10.2, GDAL 3.4.3, PROJ 8.2.0; sf_use_s2() is TRUE > library(sf) > > if (identical(Sys.getenv("NOT_CRAN"), "true")) { + test_check("rgeeExtra") + } [ FAIL 8 | WARN 0 | SKIP 0 | PASS 0 ] ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error ('test-ee_gif.R:8:1'): (code run outside of `test_that()`) ──────────── Error in `ee_connect_to_py(path = ee_current_version, n = 5)`: The current Python PATH: /usr/bin/python3 does not have the Python package "earthengine-api" installed. Are you restarted/terminated. your R session after install miniconda or run ee_install()? If no do it, please try again: > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-ee_gif.R:8:0 2. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) ── Error ('test-ee_image.R:6:1'): (code run outside of `test_that()`) ────────── Error in `ee_connect_to_py(path = ee_current_version, n = 5)`: The current Python PATH: /usr/bin/python3 does not have the Python package "earthengine-api" installed. Are you restarted/terminated. your R session after install miniconda or run ee_install()? If no do it, please try again: > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-ee_image.R:6:0 2. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) ── Error ('test-eeImageCollection.R:6:1'): (code run outside of `test_that()`) ── Error in `ee_connect_to_py(path = ee_current_version, n = 5)`: The current Python PATH: /usr/bin/python3 does not have the Python package "earthengine-api" installed. Are you restarted/terminated. your R session after install miniconda or run ee_install()? If no do it, please try again: > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-eeImageCollection.R:6:0 2. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) ── Error ('test-ops-image.R:7:1'): (code run outside of `test_that()`) ───────── Error in `ee_connect_to_py(path = ee_current_version, n = 5)`: The current Python PATH: /usr/bin/python3 does not have the Python package "earthengine-api" installed. Are you restarted/terminated. your R session after install miniconda or run ee_install()? If no do it, please try again: > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-ops-image.R:7:0 2. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) ── Error ('test-raster.R:6:1'): (code run outside of `test_that()`) ──────────── Error in `ee_connect_to_py(path = ee_current_version, n = 5)`: The current Python PATH: /usr/bin/python3 does not have the Python package "earthengine-api" installed. Are you restarted/terminated. your R session after install miniconda or run ee_install()? If no do it, please try again: > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-raster.R:6:0 2. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) ── Error ('test-subsetting-image.R:6:1'): (code run outside of `test_that()`) ── Error in `ee_connect_to_py(path = ee_current_version, n = 5)`: The current Python PATH: /usr/bin/python3 does not have the Python package "earthengine-api" installed. Are you restarted/terminated. your R session after install miniconda or run ee_install()? If no do it, please try again: > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-subsetting-image.R:6:0 2. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) ── Error ('test-subsetting-imagecollection.R:6:1'): (code run outside of `test_that()`) ── Error in `ee_connect_to_py(path = ee_current_version, n = 5)`: The current Python PATH: /usr/bin/python3 does not have the Python package "earthengine-api" installed. Are you restarted/terminated. your R session after install miniconda or run ee_install()? If no do it, please try again: > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-subsetting-imagecollection.R:6:0 2. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) ── Error ('test-subsetting.R:6:1'): (code run outside of `test_that()`) ──────── Error in `ee_connect_to_py(path = ee_current_version, n = 5)`: The current Python PATH: /usr/bin/python3 does not have the Python package "earthengine-api" installed. Are you restarted/terminated. your R session after install miniconda or run ee_install()? If no do it, please try again: > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-subsetting.R:6:0 2. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) [ FAIL 8 | WARN 0 | SKIP 0 | PASS 0 ] Error: Test failures Execution halted R CMD check generated the following check_fails: 1. no_import_package_as_a_whole 2. rcmdcheck_tests_pass 3. rcmdcheck_reasonable_installed_size #### Test coverage with [covr](https://covr.r-lib.org/) ERROR: Test Coverage Failed #### Cyclocomplexity with [cyclocomp](https://github.com/MangoTheCat/cyclocomp) The following functions have cyclocomplexity >= 15: function | cyclocomplexity --- | --- Math.ee.image.Image | 29 Ops.ee.image.Image | 22 #### Static code analyses with [lintr](https://github.com/jimhester/lintr) [lintr](https://github.com/jimhester/lintr) found the following 108 potential issues: message | number of times --- | --- Avoid library() and require() calls in packages | 4 Lines should not be more than 80 characters. | 88 Use <-, not ->, for assignment. | 16


Package Versions

|package |version | |:--------|:-------| |pkgstats |0.1.3.8 | |pkgcheck |0.1.2.3 |


Editor-in-Chief Instructions:

Processing may not proceed until the items marked with :heavy_multiplication_x: have been resolved.

csaybar commented 1 year ago

@ropensci-review-bot

maurolepore commented 1 year ago

@csaybar thanks a lot for your submission.

@mpadge kindly noted that coverage and R CMD check failed due to a missing python dependency that our system can't track. I'll need a bit of time to investigate more. Do you know a good/easy way to provide the required Python environment so that the handling editor and reviewers can hit the ground running?

csaybar commented 1 year ago

Hi @maurolepore thank you for your quick response. I just activated the notification button to this issue.

Can you confirm you're requesting a review in English?

Yes, I'd prefer to do it in English

Also, this is part of the Champions program, right?

Yes, I'm part of the program and my mentor is Marc Choisy @choisy.

Unfortunately, I haven't been able to resolve the issues related to Python dependencies. These are the same ones you can find in the pangoling package review. The Python coverage when it is evaluated in an ENV with the Python envs is around 95%. See https://app.codecov.io/gh/csaybar/rgeeExtra/tree/master/R

The flag "The following functions have no documented return values: [ee_length_ic, ee_length, ee_name_ic, ee_name, ee_subsetting, extra_Initialize, Math-methods, Ops-methods, Summary-methods] have been solved in rgee 0.0.1.999. "

csaybar commented 1 year ago

@ropensci-review-bot

maurolepore commented 1 year ago

Great, thanks for pointing me to pangoling. I'll explore how they handled installation during review.

maurolepore commented 1 year ago

@ropensci-review-bot assign @maurolepore as editor

ropensci-review-bot commented 1 year ago

Assigned! @maurolepore is now the editor

maurolepore commented 1 year ago

@csaybar, I self-assigned to be the handling editor. I think this makes sense because I would like to explore the installation process, I'm part of the Champions program, and I'm available.

I'll start working on the handling-editor's checklist. In the meantime, could you please list three potential reviewers?

Following our guidelines I'll use no more than one of them, but it's useful to have a few options and also to see the range of expertise you think is helpful.

csaybar commented 1 year ago

Hi, @maurolepore,

@ZackArno : tidyrgee creator. Experience using GEE and R.

@giswqs: geemap creator. Experience using GEE and R.

@yabellini: Experience using GEE and R.

@ricds: Experience using GEE and R.

maurolepore commented 1 year ago

@csaybar,

I can successfully install rgeeExtra but fail to run the example in README. The reprex below shows a number of helpful error messages. Although I don't show it here, I did put substantial effort in trying to follow the advice but still failed to complete the example :-(

``` r library(rgee) library(rgeeExtra) ee_Initialize() #> Welcome to the Earth Engine client library for R! #> ---------------------------------------------------------------- #> It seems it is your first time using rgee. First off, keep in mind that #> Google Earth Engine is only available to registered users, check the #> official website https://earthengine.google.com/ to get more information. #> #> Before start coding is necessary to set up a Python environment. Run #> rgee::ee_install() to set up automatically, after that, restart the R #> session to see changes. See more than 300+ examples of rgee at #> https://r-earthengine.github.io/. #> #> rgee will need to create the environmental variable "EARTHENGINE_INIT_MESSAGE" #> in your system to avoid you recieve this message again. #> Would you like to stop to receive this message? [Y/n]: #> Error in ee_connect_to_py(path = ee_current_version, n = 5): The current Python PATH: /usr/local/bin/python3 #> does not have the Python package "earthengine-api" installed. Are you restarted/terminated. #> your R session after install miniconda or run ee_install()? #> If no do it, please try again: #> > ee_install(): To create and set a Python environment with all rgee dependencies. #> > ee_install_set_pyenv(): To set a specific Python environment. extra_Initialize() #> ✔ Initializing ee_Extra module: #> Error in ee_connect_to_py(path = ee_current_version, n = 5): The current Python PATH: /usr/local/bin/python3 #> does not have the Python package "earthengine-api" installed. Do you restarted/terminated #> your R session after install miniconda or run ee_install()? #> If this is not the case, try: #> > reticulate::use_python(): Refresh your R session and manually set the Python environment with all rgee dependencies. #> > ee_install(): To create and set a Python environment with all rgee dependencies. #> > ee_install_set_pyenv(): To set a specific Python environment. img <- ee$Image("LANDSAT/LC08/C01/T1_SR/LC08_038029_20180810") #> List of 22 #> $ python : chr "/usr/local/bin/python3" #> $ libpython : chr "/opt/python/3.8.17/lib/libpython3.8.so" #> $ pythonhome : chr "/opt/python/3.8.17:/opt/python/3.8.17" #> $ pythonpath : chr "/cloud/lib/x86_64-pc-linux-gnu-library/4.3/reticulate/config:/home/r68453/.local/lib/python3.8/site-packages:/o"| __truncated__ #> $ prefix : chr "/opt/python/3.8.17" #> $ exec_prefix : chr "/opt/python/3.8.17" #> $ base_exec_prefix : chr "/opt/python/3.8.17" #> $ virtualenv : chr "" #> $ virtualenv_activate : chr "" #> $ executable : chr "/usr/local/bin/python3" #> $ base_executable : chr "/usr/local/bin/python3" #> $ version_string : chr "3.8.17 (default, Jun 6 2023, 15:28:08) [GCC 9.4.0]" #> $ version : chr "3.8" #> $ architecture : chr "64bit" #> $ anaconda : logi FALSE #> $ conda : chr "False" #> $ numpy : NULL #> $ required_module : chr "ee" #> $ required_module_path: NULL #> $ available : logi TRUE #> $ python_versions : chr "/usr/local/bin/python3" #> $ forced : chr "RETICULATE_PYTHON_FALLBACK" #> - attr(*, "class")= chr "py_config" #> Error: Python module ee was not found. #> #> Detected Python configuration: ndvi <- (img[["B5"]] - img[["B4"]])/(img[["B5"]] + img[["B4"]])**2 #> Error in eval(expr, envir, enclos): object 'img' not found names(ndvi) <- "pow_ndvi" #> Error: object 'ndvi' not found Map$centerObject(img,zoom=12) #> Error in eval(expr, envir, enclos): object 'img' not found Map$addLayer(img) #> The legacy packages maptools, rgdal, and rgeos, underpinning the sp package, #> which was just loaded, will retire in October 2023. #> Please refer to R-spatial evolution reports for details, especially #> https://r-spatial.org/r/2023/05/15/evolution4.html. #> It may be desirable to make the sf package available; #> package maintainers should consider adding sf to Suggests:. #> The sp package is now running under evolution status 2 #> (status 2 uses the sf package in place of rgdal) #> Error in eval(expr, envir, enclos): object 'img' not found ``` Created on 2023-09-26 with [reprex v2.0.2](https://reprex.tidyverse.org)

In the installation instructions of rgee I see you point to a posit.cloud project with a file that aims to quickly help a new user set everything up in a fresh environment. That seems like a good idea. Could you please do it also for rgeeExtra, so that I and the reviewers can install the package as quickly as possible?

Note however that on posit.cloud I fail to install rgee because I seem to need gcloud and I can't use sudo to install it because it's password-protected. Here is the project I used. You'll see some FIXME that explain my struggles. As rgeeExtra depends on rgee I guess simplifying the installation of rgee will also help with rgeeExtra?

If posit.cloud limits the system dependencies we can install, how else can we quickly create a working environment for the reviewers? Would it help to have a Docker image on r-hub or a Dockerfile in the repo?

csaybar commented 1 year ago

Hi @maurolepore,

I will prepare a reproducible demo in posit/colab over the weekend to facilitate the review process.

I will be sure to keep you updated.

csaybar commented 1 year ago

Hi @maurolepore

Here is an example of how to use rgeeExtra in posit cloud. https://posit.cloud/content/6670766

It is important that the rgeeExtra user has a GEE account.

Unfortunately, positCloud does not have a way to send the token back (I tried to solve this problem a year ago). Kevin Ushey, explain this here

"It's an unfortunate limitation of system() in RStudio; we currently don't have a way of routing stdin from the R process to subprocesses. You could instead run this in a separate Terminal instance for now."

image

So the rgee user who wants to use PositCloud should do so through the terminal using:

$ earthengine authenticate --auth_mode notebook

image

After that rgee & rgeeExtral will work perfectly! I attached two examples that show rgeeExtra features.

image

Feel free to reach out if there's anything I can assist you with!

maurolepore commented 1 year ago

Thanks @csaybar,

I'm sorry for the delay.

I tried your instructions for installation and usage a few times. I arrived to the version below that seems succinct and functional. What do you think?

After your review it would be nice to edit README to ensure the smoothest experience for anyone trying to install and use the package.


Installation

install.packages("remotes")
remotes::install_github("r-spatial/rgee")
remotes::install_github("r-earthengine/rgeeExtra")
rgee::ee_install()

Authenticate with Google Earth Engine

# Run in the Terminal (not in the R console)
earthengine authenticate --auth_mode notebook

Example

library(rgee)
library(rgeeExtra)

ee_Initialize()
#> ── rgee 1.1.7 ─────────────────────────────────────── earthengine-api 0.1.374 ── 
#>  ✔ user: not_defined 
#>  ✔ Initializing Google Earth Engine:
 ✔ Initializing Google Earth Engine:  DONE!
#> 
 ✔ Earth Engine account: users/mauro-test 
#> 
 ✔ Python Path: /cloud/project/rgee/bin/python 
#> ────────────────────────────────────────────────────────────────────────────────
extra_Initialize()
#>  ✔ Initializing ee_Extra module:
 ✔ Initializing ee_Extra module:  DONE!

img <- ee$Image("LANDSAT/LC08/C01/T1_SR/LC08_038029_20180810")
ndvi <- (img[["B5"]] - img[["B4"]])/(img[["B5"]] + img[["B4"]])**2
names(ndvi) <- "pow_ndvi"

Map$centerObject(img,zoom=12)
Map$addLayer(img)
#> The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,
#> which was just loaded, were retired in October 2023.
#> Please refer to R-spatial evolution reports for details, especially
#> https://r-spatial.org/r/2023/05/15/evolution4.html.
#> It may be desirable to make the sf package available;
#> package maintainers should consider adding sf to Suggests:.

Now that I can install the package I will continue with all other editor checks.

maurolepore commented 1 year ago

@ropensci-review-bot check package

ropensci-review-bot commented 1 year ago

Thanks, about to send the query.

ropensci-review-bot commented 1 year ago

:rocket:

Editor check started

:wave:

ropensci-review-bot commented 1 year ago

Checks for rgeeExtra (v0.0.1.999)

git hash: 65d95062

Important: All failing checks above must be addressed prior to proceeding

Package License: Apache License (>= 2)


1. Package Dependencies

Details of Package Dependency Usage (click to open)

The table below tallies all function calls to all packages ('ncalls'), both internal (r-base + recommended, along with the package itself), and external (imported and suggested packages). 'NA' values indicate packages to which no identified calls to R functions could be found. Note that these results are generated by an automated code-tagging system which may not be entirely accurate. |type |package | ncalls| |:----------|:-------------------|------:| |internal |base | 71| |internal |rgeeExtra | 38| |internal |graphics | 5| |internal |stats | 2| |imports |magrittr | 70| |imports |rgee | 29| |imports |reticulate | 5| |imports |crayon | NA| |imports |cli | NA| |suggests |sf | 2| |suggests |magick | 1| |suggests |testthat | NA| |suggests |googledrive | NA| |suggests |googleCloudStorageR | NA| |suggests |geojsonio | NA| |suggests |stars | NA| |suggests |knitr | NA| |suggests |rmarkdown | NA| |linking_to |NA | NA| Click below for tallies of functions used in each package. Locations of each call within this package may be generated locally by running 's <- pkgstats::pkgstats()', and examining the 'external_calls' table.

base

c (13), list (12), length (9), drop (6), for (4), lapply (3), which (3), mode (2), names (2), seq_along (2), sprintf (2), all (1), args (1), basename (1), diff (1), dirname (1), gsub (1), rep (1), scale (1), source (1), system.file (1), tempfile (1), try (1), url (1)

magrittr

%>% (70)

rgeeExtra

ee_get (3), ee_connect_to_py (2), ee_new_list_name (2), ee_source_python (2), ee_check_packages (1), ee_image_getCitation (1), ee_image_getDOI (1), ee_Image_getOffsetParams (1), ee_Image_getScaleParams (1), ee_Image_getSTAC (1), ee_Image_maskClouds (1), ee_Image_matchHistogram (1), ee_Image_panSharpen (1), ee_Image_preprocess (1), ee_Image_scaleAndOffset (1), ee_Image_spectralIndex (1), ee_Image_tasseledCap (1), ee_ImageCollection_closest (1), ee_ImageCollection_getCitation (1), ee_ImageCollection_getDOI (1), ee_ImageCollection_getOffsetParams (1), ee_ImageCollection_getScaleParams (1), ee_ImageCollection_getSTAC (1), ee_ImageCollection_panSharpen (1), ee_ImageCollection_preprocess (1), ee_ImageCollection_scaleAndOffset (1), ee_ImageCollection_spectralIndex (1), ee_ImageCollection_tasseledCap (1), ee_maxValue (1), ee_minValue (1), Math.ee.image.Image (1), Ops.ee.image.Image (1), Summary.ee.image.Image (1)

rgee

ee_as_sf (4), sf_as_ee (4), ee$ImageCollection (3), ee$ImageCollection$first (2), ee$ImageCollection$toList (2), ee$List$get (2), ee$Reducer$max (2), ee$Image (1), ee$Image$abs (1), ee$Image$bandNames (1), ee$Image$pow (1), ee$Image$unmask (1), ee$ImageCollection$getVideoThumbURL (1), ee$List$length (1), ee$List$sequence (1), ee$Number$format (1), ee$Reducer$min (1)

graphics

image (5)

reticulate

import_from_path (4), py_discover_config (1)

sf

st_cast (2)

stats

offset (2)

magick

image_read (1)

**NOTE:** Some imported packages appear to have no associated function calls; please ensure with author that these 'Imports' are listed appropriately.


2. Statistical Properties

This package features some noteworthy statistical properties which may need to be clarified by a handling editor prior to progressing.

Details of statistical properties (click to open)

The package has: - code in R (100% in 12 files) and - 1 authors - 2 vignettes - no internal data file - 5 imported packages - 45 exported functions (median 4 lines of code) - 63 non-exported functions in R (median 8 lines of code) --- Statistical properties of package structure as distributional percentiles in relation to all current CRAN packages The following terminology is used: - `loc` = "Lines of Code" - `fn` = "function" - `exp`/`not_exp` = exported / not exported All parameters are explained as tooltips in the locally-rendered HTML version of this report generated by [the `checks_to_markdown()` function](https://docs.ropensci.org/pkgcheck/reference/checks_to_markdown.html) The final measure (`fn_call_network_size`) is the total number of calls between functions (in R), or more abstract relationships between code objects in other languages. Values are flagged as "noteworthy" when they lie in the upper or lower 5th percentile. |measure | value| percentile|noteworthy | |:------------------------|-----:|----------:|:----------| |files_R | 12| 65.5| | |files_vignettes | 2| 85.7| | |files_tests | 9| 89.6| | |loc_R | 826| 62.7| | |loc_vignettes | 120| 31.3| | |loc_tests | 477| 74.0| | |num_vignettes | 2| 89.2| | |n_fns_r | 108| 78.4| | |n_fns_r_exported | 45| 86.2| | |n_fns_r_not_exported | 63| 73.5| | |n_fns_per_file_r | 6| 75.7| | |num_params_per_fn | 2| 11.9| | |loc_per_fn_r | 5| 8.1| | |loc_per_fn_r_exp | 4| 4.3|TRUE | |loc_per_fn_r_not_exp | 8| 22.6| | |rel_whitespace_R | 15| 59.3| | |rel_whitespace_vignettes | 50| 45.3| | |rel_whitespace_tests | 31| 80.2| | |doclines_per_fn_exp | 29| 31.0| | |doclines_per_fn_not_exp | 0| 0.0|TRUE | |fn_call_network_size | 13| 37.5| | ---

2a. Network visualisation

Click to see the interactive network visualisation of calls between objects in package


3. goodpractice and other checks

Details of goodpractice checks (click to open)

#### 3a. Continuous Integration Badges [![R-CMD-check.yaml](https://github.com/r-earthengine/rgeeExtra/actions/workflows/R-CMD-check.yaml"> ee_install_upgrade(): Install the latest Earth Engine Python version. > reticulate::use_python(): Refresh your R session and manually set the Python environment with all rgee dependencies. > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-ee_gif.R:8:0 2. └─rgee:::ee_check_init() 3. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) ── Error ('test-ee_image.R:6:1'): (code run outside of `test_that()`) ────────── Error in `ee_connect_to_py(path = ee_current_version, n = 5)`: The current Python PATH: /usr/bin/python3 does not have the Python package "earthengine-api" installed. Do you restarted/terminated your R session after install miniconda or run ee_install()? If this is not the case, try: > ee_install_upgrade(): Install the latest Earth Engine Python version. > reticulate::use_python(): Refresh your R session and manually set the Python environment with all rgee dependencies. > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-ee_image.R:6:0 2. └─rgee:::ee_check_init() 3. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) ── Error ('test-eeImageCollection.R:6:1'): (code run outside of `test_that()`) ── Error in `ee_connect_to_py(path = ee_current_version, n = 5)`: The current Python PATH: /usr/bin/python3 does not have the Python package "earthengine-api" installed. Do you restarted/terminated your R session after install miniconda or run ee_install()? If this is not the case, try: > ee_install_upgrade(): Install the latest Earth Engine Python version. > reticulate::use_python(): Refresh your R session and manually set the Python environment with all rgee dependencies. > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-eeImageCollection.R:6:0 2. └─rgee:::ee_check_init() 3. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) ── Error ('test-ops-image.R:7:1'): (code run outside of `test_that()`) ───────── Error in `ee_connect_to_py(path = ee_current_version, n = 5)`: The current Python PATH: /usr/bin/python3 does not have the Python package "earthengine-api" installed. Do you restarted/terminated your R session after install miniconda or run ee_install()? If this is not the case, try: > ee_install_upgrade(): Install the latest Earth Engine Python version. > reticulate::use_python(): Refresh your R session and manually set the Python environment with all rgee dependencies. > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-ops-image.R:7:0 2. └─rgee:::ee_check_init() 3. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) ── Error ('test-raster.R:6:1'): (code run outside of `test_that()`) ──────────── Error in `ee_connect_to_py(path = ee_current_version, n = 5)`: The current Python PATH: /usr/bin/python3 does not have the Python package "earthengine-api" installed. Do you restarted/terminated your R session after install miniconda or run ee_install()? If this is not the case, try: > ee_install_upgrade(): Install the latest Earth Engine Python version. > reticulate::use_python(): Refresh your R session and manually set the Python environment with all rgee dependencies. > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-raster.R:6:0 2. └─rgee:::ee_check_init() 3. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) ── Error ('test-subsetting-image.R:6:1'): (code run outside of `test_that()`) ── Error in `ee_connect_to_py(path = ee_current_version, n = 5)`: The current Python PATH: /usr/bin/python3 does not have the Python package "earthengine-api" installed. Do you restarted/terminated your R session after install miniconda or run ee_install()? If this is not the case, try: > ee_install_upgrade(): Install the latest Earth Engine Python version. > reticulate::use_python(): Refresh your R session and manually set the Python environment with all rgee dependencies. > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-subsetting-image.R:6:0 2. └─rgee:::ee_check_init() 3. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) ── Error ('test-subsetting-imagecollection.R:6:1'): (code run outside of `test_that()`) ── Error in `ee_connect_to_py(path = ee_current_version, n = 5)`: The current Python PATH: /usr/bin/python3 does not have the Python package "earthengine-api" installed. Do you restarted/terminated your R session after install miniconda or run ee_install()? If this is not the case, try: > ee_install_upgrade(): Install the latest Earth Engine Python version. > reticulate::use_python(): Refresh your R session and manually set the Python environment with all rgee dependencies. > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-subsetting-imagecollection.R:6:0 2. └─rgee:::ee_check_init() 3. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) ── Error ('test-subsetting.R:6:1'): (code run outside of `test_that()`) ──────── Error in `ee_connect_to_py(path = ee_current_version, n = 5)`: The current Python PATH: /usr/bin/python3 does not have the Python package "earthengine-api" installed. Do you restarted/terminated your R session after install miniconda or run ee_install()? If this is not the case, try: > ee_install_upgrade(): Install the latest Earth Engine Python version. > reticulate::use_python(): Refresh your R session and manually set the Python environment with all rgee dependencies. > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-subsetting.R:6:0 2. └─rgee:::ee_check_init() 3. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) [ FAIL 8 | WARN 0 | SKIP 0 | PASS 0 ] Error: Test failures Execution halted R CMD check generated the following check_fails: 1. no_import_package_as_a_whole 2. rcmdcheck_tests_pass 3. rcmdcheck_reasonable_installed_size #### Test coverage with [covr](https://covr.r-lib.org/) ERROR: Test Coverage Failed #### Cyclocomplexity with [cyclocomp](https://github.com/MangoTheCat/cyclocomp) The following functions have cyclocomplexity >= 15: function | cyclocomplexity --- | --- Math.ee.image.Image | 29 Ops.ee.image.Image | 22 #### Static code analyses with [lintr](https://github.com/jimhester/lintr) [lintr](https://github.com/jimhester/lintr) found the following 111 potential issues: message | number of times --- | --- Avoid library() and require() calls in packages | 4 Lines should not be more than 80 characters. | 91 Use <-, not ->, for assignment. | 16


Package Versions

|package |version | |:--------|:-------| |pkgstats |0.1.3.9 | |pkgcheck |0.1.2.9 |


Editor-in-Chief Instructions:

Processing may not proceed until the items marked with :heavy_multiplication_x: have been resolved.

csaybar commented 1 year ago

Hi @maurolepore, we know that setting up an environment with both Python and R can be a bit tiring. Unfortunately, there's not much we can do from our end since the connection relies on reticulate. I've updated the README for rgeeExtra and included a link that explains how to install rgee Python dependencies. Hope it can help.

maurolepore commented 1 year ago

Editor checks:

Editor comments

@csaybar,

To help you track my comments, I'll label them with "ml" and a numerical sequence like ml01, ml02, and so on. Bullets and checkboxes mark whether or not I expect input from you:

--

The package has sufficient documentation available online (README, pkgdown docs) to allow for an assessment of functionality and scope without installing the package.

You may evaluate code chunks in .Rmd or .qmd documents or with the reprex package. It's best to use the option comment = "#>" so that the motivated reader can copy/paste/run without errors.

Is the case for the package well made?

Note the output of usethis::use_readme_rmd() starts with "The goal of {{{ Package }}} is to ...".

Currently the top of README talks about GEE and rgee but not rgeeExtra (What is Google Earth Engine?). The reader sees the Installation of rgeeExtra before knowing about it.

I think the best case for the package is made at top of the Features article. Moving this text to the top or README and rewording it to answer "why" rather than "what" would solve the problem :-)

rgeeExtra serves as a wrapper for the Python package named eeExtra. The creation of eeExtra was driven by a need to consolidate various third-party GEE packages and projects found on GitHub.

rgeeExtra ensures a seamless integration of these projects across different programming languages by standardizing methods and facilitating the use of JavaScript code projects beyond the traditional Code Editor environment.

Also in other places I see text that can help make the case for the package:

https://r-earthengine.com/rgeeExtra/articles/Introduction.html:

rgeeExtra is an extension of the rgee package, enhancing the capabilities of Google Earth Engine (GEE) integration within the R environment.

https://r-earthengine.com/rgeeExtra/index.html#how-does-it-work:

The rgeeExtra extends the following Earth Engine classes: ...

Is the reference index page clear (grouped by topic if necessary)?

Are vignettes readable, sufficiently detailed and not just perfunctory?

Fit: The package meets criteria for fit and overlap.

Installation instructions: Are installation instructions clear enough for human users?

Tests: If the package has some interactivity / HTTP / plot production etc. are the tests using state-of-the-art tooling?

Contributing Is: information the documentation for contribution clear enough e.g. tokens for tests, playgrounds?

License: The package has a CRAN or OSI accepted license.

Yes.

Project management: Are the issue and PR trackers in a good shape, e.g. are there outstanding bugs, is it clear when feature requests are meant to be tackled?

Also

#> The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,
#> which was just loaded, were retired in October 2023.
#> Please refer to R-spatial evolution reports for details, especially
#> https://r-spatial.org/r/2023/05/15/evolution4.html.
#> It may be desirable to make the sf package available;
#> package maintainers should consider adding sf to Suggests:.

I'm puzzled. Both rgee and rgeeExtra are alraedy using sf. Do you know where this is comming from?

maurolepore commented 1 year ago

@csaybar,

Thanks for your patience. My feedback took time but I hope it will also save reviewers time later. Please address my comments before I start searching for reviewers.

csaybar commented 1 year ago

Hi @maurolepore, I apologize for the delayed response, and I quite appreciate all your comments. I plan to begin addressing your feedback during the next week. Have a good weekend!

csaybar commented 1 year ago

Hi, @maurolepore! I'm pleased to inform you that a new version of RgeeExtra has been released (v0.1.0). We've made comprehensive improvements to the documentation and included numerous additional examples. Please find attached the responses addressing all your comments. https://r-earthengine.com/rgeeExtra/ Demo here: https://posit.cloud/content/6670766

m01

We have updated our example documentation to include both code and their corresponding outputs. This enhancement facilitates a better understanding and allows readers to easily copy, paste, and execute examples without any issues, aligning with the core idea of rgeeExtra, improving the user experience of R users when they have to use GEE APi.

m02

The updated README now clearly explains the goal and the why of rgeeExtra at the top, providing more clarity to new users.

m03

The support for R6 classes in roxygen2/pkgdown (reticulate) is still a bit buggy, we have been trying some workarounds, and now the method classes are available in the reference index.

m06

The installation instructions in the README have been revised and tested in Windows and Linux OS, ensuring they are clear and functional for all users.

m07/08/09

We have ensured that each function in the R/ folder has a corresponding test file in test/testthat/. We updated the codecov state: https://app.codecov.io/github/csaybar/rgeeExtra/tree/master All the 135 now pass successfully.

m10

We include the following line in the installation section: 'For additional details on connecting GEE and R, refer to the information provided here. To set up an account, click here.'"

m11

We have made a lot of changes to the API in the past, and all the issues reported were associated with previous versions that are no longer supported. For the first time, we have released a stable version (v.0.1.0), and our intention from now is to maintain its stability respecting the API, we decided.

Regarding the R spatial legacy dependency issues, we currently have an indirect dependency on leafletExtra2. Unfortunately, this package has not yet initiated the transition to sf.

maurolepore commented 1 year ago

Thanks a lot @csaybar!

Over the next few days I'll review your response and move on to searching for reviewers.

maurolepore commented 12 months ago

Dear @csaybar,

I'm exploring the potential reviewers you listed above and realize I forgot to highlight that our policies about conflict of interest for reviewers (COI) might shrink the list. For example, David's profile suggest a COI: "I'm the ... co-creator of eeExtra and easystac (with the incredible @csaybar)". If that contribution was within the last year, then it would be considered a COI.

Can you please review the list with COI in mind? And while you're there, please briefly explain why you would value the revew of each one in your list? This is useful for me to sense what kind of experience you're looking for, so I can search for a similar profile elsewhere.

And if your list above already considers COI then great. I just need to confirm.

csaybar commented 12 months ago

Hi @maurolepore, my apologies for the confusion. I have updated the list in accordance with the COI and added a brief explanation. Please let me know if you have any questions or need further clarification. Thank you!

maurolepore commented 11 months ago

@ropensci-review-bot assign @nmorandeira as reviewer

ropensci-review-bot commented 11 months ago

@nmorandeira added to the reviewers list. Review due date is 2023-12-26. Thanks @nmorandeira for accepting to review! Please refer to our reviewer guide.

rOpenSci’s community is our best asset. We aim for reviews to be open, non-adversarial, and focused on improving software quality. Be respectful and kind! See our reviewers guide and code of conduct for more.

ropensci-review-bot commented 11 months ago

@nmorandeira: If you haven't done so, please fill this form for us to update our reviewers records.

maurolepore commented 11 months ago

@ropensci-review-bot assign @zackarno as reviewer

ropensci-review-bot commented 11 months ago

@zackarno added to the reviewers list. Review due date is 2023-12-26. Thanks @zackarno for accepting to review! Please refer to our reviewer guide.

rOpenSci’s community is our best asset. We aim for reviews to be open, non-adversarial, and focused on improving software quality. Be respectful and kind! See our reviewers guide and code of conduct for more.

ropensci-review-bot commented 11 months ago

@zackarno: If you haven't done so, please fill this form for us to update our reviewers records.

maurolepore commented 11 months ago

@ropensci-review-bot check package

maurolepore commented 11 months ago

@ropensci-review-bot help

ropensci-review-bot commented 11 months ago

Hello @maurolepore, 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
maurolepore commented 11 months ago

@ropensci-review-bot check package

ropensci-review-bot commented 11 months ago

Thanks, about to send the query.

ropensci-review-bot commented 11 months ago

:rocket:

The following problem was found in your submission template:

:wave:

ropensci-review-bot commented 11 months ago

Checks for rgeeExtra (v0.1.0)

git hash: 7ea67d06

Important: All failing checks above must be addressed prior to proceeding

Package License: Apache License (>= 2)


1. Package Dependencies

Details of Package Dependency Usage (click to open)

The table below tallies all function calls to all packages ('ncalls'), both internal (r-base + recommended, along with the package itself), and external (imported and suggested packages). 'NA' values indicate packages to which no identified calls to R functions could be found. Note that these results are generated by an automated code-tagging system which may not be entirely accurate. |type |package | ncalls| |:----------|:-------------------|------:| |internal |base | 60| |internal |rgeeExtra | 55| |internal |graphics | 6| |internal |stats | 2| |imports |magrittr | 68| |imports |rgee | 27| |imports |reticulate | 5| |imports |crayon | NA| |imports |cli | NA| |suggests |sf | 2| |suggests |magick | 1| |suggests |testthat | NA| |suggests |googledrive | NA| |suggests |googleCloudStorageR | NA| |suggests |geojsonio | NA| |suggests |stars | NA| |suggests |knitr | NA| |suggests |rmarkdown | NA| |linking_to |NA | NA| Click below for tallies of functions used in each package. Locations of each call within this package may be generated locally by running 's <- pkgstats::pkgstats()', and examining the 'external_calls' table.

magrittr

%>% (68)

base

list (12), length (8), c (7), for (4), drop (3), which (3), lapply (2), mode (2), names (2), seq_along (2), sprintf (2), all (1), args (1), basename (1), diff (1), dirname (1), gsub (1), rep (1), scale (1), source (1), tempfile (1), try (1), tryCatch (1), url (1)

rgeeExtra

load_ee_Extra (20), ee_get (3), ee_new_list_name (2), ee_source_python (2), ee_check_packages (1), ee_connect_to_py (1), ee_image_getCitation (1), ee_image_getDOI (1), ee_Image_getOffsetParams (1), ee_Image_getScaleParams (1), ee_Image_getSTAC (1), ee_Image_maskClouds (1), ee_Image_matchHistogram (1), ee_Image_panSharpen (1), ee_Image_preprocess (1), ee_Image_scaleAndOffset (1), ee_Image_spectralIndex (1), ee_Image_tasseledCap (1), ee_ImageCollection_closest (1), ee_ImageCollection_getCitation (1), ee_ImageCollection_getDOI (1), ee_ImageCollection_getOffsetParams (1), ee_ImageCollection_getScaleParams (1), ee_ImageCollection_getSTAC (1), ee_ImageCollection_preprocess (1), ee_ImageCollection_scaleAndOffset (1), ee_maxValue (1), ee_minValue (1), ee_utils_gif_annotate (1), Math.ee.image.Image (1), Ops.ee.image.Image (1), Summary.ee.image.Image (1)

rgee

ee_as_sf (4), sf_as_ee (4), ee$ImageCollection (2), ee$ImageCollection$first (2), ee$ImageCollection$toList (2), ee$List$get (2), ee$Reducer$max (2), ee$Image$abs (1), ee$Image$bandNames (1), ee$Image$pow (1), ee$Image$unmask (1), ee$ImageCollection$getVideoThumbURL (1), ee$List$length (1), ee$List$sequence (1), ee$Number$format (1), ee$Reducer$min (1)

graphics

image (6)

reticulate

import_from_path (4), py_discover_config (1)

sf

st_cast (2)

stats

offset (2)

magick

image_read (1)

**NOTE:** Some imported packages appear to have no associated function calls; please ensure with author that these 'Imports' are listed appropriately.


2. Statistical Properties

This package features some noteworthy statistical properties which may need to be clarified by a handling editor prior to progressing.

Details of statistical properties (click to open)

The package has: - code in R (100% in 12 files) and - 1 authors - 7 vignettes - no internal data file - 5 imported packages - 42 exported functions (median 5 lines of code) - 54 non-exported functions in R (median 9 lines of code) --- Statistical properties of package structure as distributional percentiles in relation to all current CRAN packages The following terminology is used: - `loc` = "Lines of Code" - `fn` = "function" - `exp`/`not_exp` = exported / not exported All parameters are explained as tooltips in the locally-rendered HTML version of this report generated by [the `checks_to_markdown()` function](https://docs.ropensci.org/pkgcheck/reference/checks_to_markdown.html) The final measure (`fn_call_network_size`) is the total number of calls between functions (in R), or more abstract relationships between code objects in other languages. Values are flagged as "noteworthy" when they lie in the upper or lower 5th percentile. |measure | value| percentile|noteworthy | |:------------------------|-----:|----------:|:----------| |files_R | 12| 65.5| | |files_vignettes | 7| 98.5| | |files_tests | 9| 89.6| | |loc_R | 781| 61.1| | |loc_vignettes | 783| 87.0| | |loc_tests | 431| 72.0| | |num_vignettes | 7| 99.2|TRUE | |n_fns_r | 96| 75.4| | |n_fns_r_exported | 42| 85.0| | |n_fns_r_not_exported | 54| 69.6| | |n_fns_per_file_r | 5| 71.2| | |num_params_per_fn | 2| 11.9| | |loc_per_fn_r | 6| 12.1| | |loc_per_fn_r_exp | 5| 7.3| | |loc_per_fn_r_not_exp | 9| 27.1| | |rel_whitespace_R | 16| 58.8| | |rel_whitespace_vignettes | 54| 95.8|TRUE | |rel_whitespace_tests | 31| 78.2| | |doclines_per_fn_exp | 38| 47.0| | |doclines_per_fn_not_exp | 0| 0.0|TRUE | |fn_call_network_size | 32| 57.0| | ---

2a. Network visualisation

Click to see the interactive network visualisation of calls between objects in package


3. goodpractice and other checks

Details of goodpractice checks (click to open)

#### 3a. Continuous Integration Badges [![R-CMD-check.yaml](https://github.com/r-earthengine/rgeeExtra/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-earthengine/rgeeExtra/actions) **GitHub Workflow Results** | id|name |conclusion |sha | run_number|date | |----------:|:--------------------------|:----------|:------|----------:|:----------| | 6970934713|pages build and deployment |success |cfa68b | 18|2023-11-23 | | 6970898064|pkgdown |success |7ea67d | 37|2023-11-23 | | 6970898063|R-CMD-check |failure |7ea67d | 37|2023-11-23 | | 6969328799|test-coverage |failure |a31019 | 9|2023-11-23 | --- #### 3b. `goodpractice` results #### `R CMD check` with [rcmdcheck](https://r-lib.github.io/rcmdcheck/) R CMD check generated the following error: 1. checking tests ... Running ‘testthat.R’ ERROR Running the tests in ‘tests/testthat.R’ failed. Last 13 lines of output: your R session after install miniconda or run ee_install()? If this is not the case, try: > ee_install_upgrade(): Install the latest Earth Engine Python version. > reticulate::use_python(): Refresh your R session and manually set the Python environment with all rgee dependencies. > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-subsetting.R:4:1 2. └─rgee:::ee_check_init() 3. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) [ FAIL 8 | WARN 0 | SKIP 0 | PASS 0 ] Error: Test failures Execution halted R CMD check generated the following note: 1. checking installed package size ... NOTE installed size is 15.3Mb sub-directories of 1Mb or more: doc 12.4Mb ee_extra 1.6Mb R CMD check generated the following test_fail: 1. > # This file is part of the standard setup for testthat. > # It is recommended that you do not modify it. > # > # Where should you do additional test configuration? > # Learn more about the roles of various files in: > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview > # * https://testthat.r-lib.org/articles/special-files.html > > library(testthat) > library(rgeeExtra) > > test_check("rgeeExtra") [ FAIL 8 | WARN 0 | SKIP 0 | PASS 0 ] ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error ('test-ee_gif.R:4:1'): (code run outside of `test_that()`) ──────────── Error in `ee_connect_to_py(path = ee_current_version, n = 5)`: The current Python PATH: /usr/bin/python3 does not have the Python package "earthengine-api" installed. Do you restarted/terminated your R session after install miniconda or run ee_install()? If this is not the case, try: > ee_install_upgrade(): Install the latest Earth Engine Python version. > reticulate::use_python(): Refresh your R session and manually set the Python environment with all rgee dependencies. > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-ee_gif.R:4:1 2. └─rgee:::ee_check_init() 3. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) ── Error ('test-ee_image.R:4:1'): (code run outside of `test_that()`) ────────── Error in `ee_connect_to_py(path = ee_current_version, n = 5)`: The current Python PATH: /usr/bin/python3 does not have the Python package "earthengine-api" installed. Do you restarted/terminated your R session after install miniconda or run ee_install()? If this is not the case, try: > ee_install_upgrade(): Install the latest Earth Engine Python version. > reticulate::use_python(): Refresh your R session and manually set the Python environment with all rgee dependencies. > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-ee_image.R:4:1 2. └─rgee:::ee_check_init() 3. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) ── Error ('test-eeImageCollection.R:4:1'): (code run outside of `test_that()`) ── Error in `ee_connect_to_py(path = ee_current_version, n = 5)`: The current Python PATH: /usr/bin/python3 does not have the Python package "earthengine-api" installed. Do you restarted/terminated your R session after install miniconda or run ee_install()? If this is not the case, try: > ee_install_upgrade(): Install the latest Earth Engine Python version. > reticulate::use_python(): Refresh your R session and manually set the Python environment with all rgee dependencies. > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-eeImageCollection.R:4:1 2. └─rgee:::ee_check_init() 3. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) ── Error ('test-ops-image.R:4:1'): (code run outside of `test_that()`) ───────── Error in `ee_connect_to_py(path = ee_current_version, n = 5)`: The current Python PATH: /usr/bin/python3 does not have the Python package "earthengine-api" installed. Do you restarted/terminated your R session after install miniconda or run ee_install()? If this is not the case, try: > ee_install_upgrade(): Install the latest Earth Engine Python version. > reticulate::use_python(): Refresh your R session and manually set the Python environment with all rgee dependencies. > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-ops-image.R:4:1 2. └─rgee:::ee_check_init() 3. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) ── Error ('test-raster.R:4:1'): (code run outside of `test_that()`) ──────────── Error in `ee_connect_to_py(path = ee_current_version, n = 5)`: The current Python PATH: /usr/bin/python3 does not have the Python package "earthengine-api" installed. Do you restarted/terminated your R session after install miniconda or run ee_install()? If this is not the case, try: > ee_install_upgrade(): Install the latest Earth Engine Python version. > reticulate::use_python(): Refresh your R session and manually set the Python environment with all rgee dependencies. > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-raster.R:4:1 2. └─rgee:::ee_check_init() 3. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) ── Error ('test-subsetting-image.R:4:1'): (code run outside of `test_that()`) ── Error in `ee_connect_to_py(path = ee_current_version, n = 5)`: The current Python PATH: /usr/bin/python3 does not have the Python package "earthengine-api" installed. Do you restarted/terminated your R session after install miniconda or run ee_install()? If this is not the case, try: > ee_install_upgrade(): Install the latest Earth Engine Python version. > reticulate::use_python(): Refresh your R session and manually set the Python environment with all rgee dependencies. > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-subsetting-image.R:4:1 2. └─rgee:::ee_check_init() 3. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) ── Error ('test-subsetting-imagecollection.R:4:1'): (code run outside of `test_that()`) ── Error in `ee_connect_to_py(path = ee_current_version, n = 5)`: The current Python PATH: /usr/bin/python3 does not have the Python package "earthengine-api" installed. Do you restarted/terminated your R session after install miniconda or run ee_install()? If this is not the case, try: > ee_install_upgrade(): Install the latest Earth Engine Python version. > reticulate::use_python(): Refresh your R session and manually set the Python environment with all rgee dependencies. > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-subsetting-imagecollection.R:4:1 2. └─rgee:::ee_check_init() 3. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) ── Error ('test-subsetting.R:4:1'): (code run outside of `test_that()`) ──────── Error in `ee_connect_to_py(path = ee_current_version, n = 5)`: The current Python PATH: /usr/bin/python3 does not have the Python package "earthengine-api" installed. Do you restarted/terminated your R session after install miniconda or run ee_install()? If this is not the case, try: > ee_install_upgrade(): Install the latest Earth Engine Python version. > reticulate::use_python(): Refresh your R session and manually set the Python environment with all rgee dependencies. > ee_install(): To create and set a Python environment with all rgee dependencies. > ee_install_set_pyenv(): To set a specific Python environment. Backtrace: ▆ 1. └─rgee::ee_Initialize() at test-subsetting.R:4:1 2. └─rgee:::ee_check_init() 3. └─rgee:::ee_connect_to_py(path = ee_current_version, n = 5) [ FAIL 8 | WARN 0 | SKIP 0 | PASS 0 ] Error: Test failures Execution halted R CMD check generated the following check_fails: 1. no_import_package_as_a_whole 2. rcmdcheck_tests_pass 3. rcmdcheck_reasonable_installed_size #### Test coverage with [covr](https://covr.r-lib.org/) ERROR: Test Coverage Failed #### Cyclocomplexity with [cyclocomp](https://github.com/MangoTheCat/cyclocomp) The following functions have cyclocomplexity >= 15: function | cyclocomplexity --- | --- Math.ee.image.Image | 29 Ops.ee.image.Image | 22 #### Static code analyses with [lintr](https://github.com/jimhester/lintr) [lintr](https://github.com/jimhester/lintr) found the following 167 potential issues: message | number of times --- | --- Avoid library() and require() calls in packages | 14 Lines should not be more than 80 characters. | 132 Use <-, not ->, for assignment. | 17 Use <-, not =, for assignment. | 4


Package Versions

|package |version | |:--------|:--------| |pkgstats |0.1.3.9 | |pkgcheck |0.1.2.11 |


Editor-in-Chief Instructions:

Processing may not proceed until the items marked with :heavy_multiplication_x: have been resolved.

mdelfin commented 11 months ago

Muy buenos das, pero alseguir todos los pasos, desde instalar hasta autenticar en la terminal, hasta ahi. TODO MUY BIEN, pero al momento de correr el ejemplo, me sale este mensaje. Agradezco cualquier aporte. Saludos desde Bolivia. cesar

maurolepore commented 11 months ago

Hola @mdelfin,

Muchas gracias por tu interes in rgeeExtra y por tu feedback. Nota que esta pagina esta dedicada al proceso de revision de rOpenSci.

Quizas estas buscando esta otra pagina?

https://github.com/r-earthengine/rgeeExtra/issues

mdelfin commented 11 months ago

Hola Mauro, la verdad estoy haciendo una app en shiny y con conexion a google earth engine con la liberia rgee, lo que mencionan en la parte de los comentarios, es la conexion con POSIT CLOUD, es ahi donde tengo el problema, no puedo conectar, ya que los pasos que mencionan de la termninal, esto esta todo muy bien, PERO al momento de relalizar el ejercicion con ee_Initialize(), vuelve el mismo problema que menciona ustedes en la parte de arriba. Saludos

ropensci-review-bot commented 11 months ago

:calendar: @nmorandeira you have 2 days left before the due date for your review (2023-12-26).

ropensci-review-bot commented 11 months ago

:calendar: @zackarno you have 2 days left before the due date for your review (2023-12-26).

maurolepore commented 10 months ago

Happy new year everyone!

@nmorandeira and @zackarno, I see your due date was inconveniently in the holiday period, so I think it's fair to expect your reviews a bit later than scheduled. Looking forward to them.

maurolepore commented 10 months ago

Feliz 2024 @mdelfin. Por favor nota que este no es el lugar para hacer preguntas sobre el paquete. Por favor dirigijte a https://github.com/r-earthengine/rgeeExtra/issues

zackarno commented 10 months ago

Happy new years! @maurolepore thanks ! I'm hoping/aiming to get it finished this week!

zackarno commented 10 months ago

@csaybar - Thanks for the fantastic package and the chance to review! I look forward to incorporating it into my work and exploring more use-cases over time!

I attempted to limit the scope of my review to just {rgeeExtra}, avoid {rgee} functionality, and also not dig into the EE_extra/EE-Mont python packages which are wrapped.

Below is my review, I tried to tag each comment with a #uid for ease of referencing.There is so much cool stuff here that I feel like I could keep digging for a while longer, but will have to stop myself here:

Package Review

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

Documentation

The package includes all the following forms of documentation:

Functionality

Estimated hours spent reviewing: 16 - probably longer than it should have given it was my first review.

Review Comments

General Comments

Documentation - Installation instructions

Documentation - Examples

Documentation - Functions

Documentation - Vignettes

Functionality/ User Experience

Functionality -Installation

Functionality - Functionality

library(rgee)
library(rgeeExtra)
library(tidyverse)
ee_Initialize()
extra_Initialize()

url_s2 <- "COPERNICUS/S2"
ic <- ee$ImageCollection(url_s2)

date_chr <- "2023-09-10"
date_dt<- as_date(date_chr)
ic_closest_from_dt_obj <-  ic$Extra_closest(date_dt)
#> Error in py_call_impl(callable, call_args$unnamed, call_args$named) : 
#>   ee.ee_exception.EEException: Invalid argument specified for ee.Date(): 2023-09-10
#> Run `reticulate::py_last_error()` for details.
ic_closest <-  ic$Extra_closest(date_chr) # works
class(ic_closest)
#> [1] "ee.imagecollection.ImageCollection" "ee.collection.Collection"           "ee.element.Element"                
#>[4] "ee.computedobject.ComputedObject"   "ee.encodable.Encodable"             "python.builtin.object"  

# if I run this in combination with above chunk my R session will freeze/abort
ee_get_date_ic(ic_closest)

make geom

geometry = ee$Geometry$Polygon( list( c(-155.97117211519446, 20.09006980142336), c(-155.97117211519446, 19.7821681268256), c(-155.73256280122962, 19.7821681268256), c(-155.73256280122962, 20.09006980142336) ) ) skysat = ee$Image('SKYSAT/GEN-A/PUBLIC/ORTHO/RGB/s01_20161020T214047Z')$clip(geometry) landsat_ic = ee$ImageCollection('LANDSAT/LC08/C01/T1_SR')$ filterBounds(geometry) %>%

leaving as default -- this is probably wrong! but not super clear how to adjust

would be nice if vignettes showed good default presets for at least landsat & and sentinel 2

ee$ImageCollection$Extra_preprocess()

date_skysat <- ee_get_date_img(skysat)$time_start # if you run Extra_closest w/ this it aborts session date_skysat_chr<- as.character(as_date(date_skysat))

landsat_ic_closest <- ee$ImageCollection$Extra_closest(landsat_ic ,date_skysat_chr,32,"day")

would be nice if Extra_closest returns img in the above

landsat_img_closest <- landsat_ic_closest[[1]] # but alas we have to convert it

landsat_img_rgb <- landsat_img_closest$select( opt_selectors = c( "B4","B3","B2"), opt_names = c("R","G","B") )

bands <- list("R"="R","G"="G","B"="B") matched <- ee$Image$Extra_matchHistogram(skysat,landsat_img_rgb, bands)

vis_params_refl = list('min'=0, 'max'= 0.25) vis_params_dn = list('min'= 0, 'max'= 255) aoi_center_pt <- ee$Geometry$Point(c(-155.79584,19.9986)) Map$centerObject(aoi_center_pt,13)

m1 <- Map$addLayer(landsat_img_rgb, visParams = vis_params_refl,"landsat ref") m2 <- Map$addLayer(skysat,visParams= vis_params_dn, 'SkySat source') m1|m2 # looks good m3 <- Map$addLayer(matched,visParams= vis_params_refl, 'SkySat matched') m4 <- Map$addLayer(matched,visParams= vis_params_dn, 'SkySat matched') m1|m3 # matches is just black m1|m4 # matches is just black


For a user like me who wrote the code below what are some tools we have from `{rgee}` and `{rgeeExtra}` to help troubleshoot and figure out what is going on? This is all I can think of right now but doesn't get me much further? #za_ff7
```{r}
# trying to trouble shoot - wrote this before I THINK i might have identified the problem
# in leaving the Extra_preprocess as default
rgeeExtra::ee_minValue(landsat_img_rgb) 
rgeeExtra::ee_maxValue(landsat_img_rgb) 
rgeeExtra::ee_minValue(skysat)
rgeeExtra::ee_maxValue(skysat) 

rgeeExtra::ee_minValue(matched) # all 0s
rgeeExtra::ee_maxValue(matched) # all 0s

Functionality - Code style

doi <- ee$ImageCollection("NASA/GPM_L3/IMERG_V06")[[1]] %>%
  ee$Image$Extra_getDOI()

rather than:

doi <- ee$ImageCollection("NASA/GPM_L3/IMERG_V06")[[1]]$
  Extra_getDOI()

ic <- ee$ImageCollection("NASA/GPM_L3/IMERG_V06")