Skip to content

Commit

Permalink
Merge pull request #69 from r-spatial/JOSS
Browse files Browse the repository at this point in the history
JOSS rgee: Address suggested changes of the review - rgee 1.0.0
  • Loading branch information
csaybar committed Jul 14, 2020
2 parents bea78da + 332f4fc commit b9d7601
Show file tree
Hide file tree
Showing 97 changed files with 2,095 additions and 2,300 deletions.
2 changes: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
^vignettes\setup.Rmd
^vignettes\BestPractices.Rmd
^vignettes\thumb_down.png
^vignettes\thumb_up.png
^vignettes\thumb_up.png
8 changes: 4 additions & 4 deletions .github/decrypt_secret.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/bin/sh

# Decrypt the file
mkdir -p $HOME/.config/earthengine/data.colec.fbf/
mkdir -p $HOME/.config/earthengine/ndef/

# --batch to prevent interactive command --yes to assume "yes" for questions
gpg --quiet --batch --yes --decrypt --passphrase="$RGEE_SECRET_PASSPHRASE" \
--output $HOME/.config/earthengine/data.colec.fbf/GCS_AUTH_FILE.json \
--output $HOME/.config/earthengine/ndef/GCS_AUTH_FILE.json \
./tests/credentials/GCS_AUTH_FILE.json.gpg

gpg --quiet --batch --yes --decrypt --passphrase="$RGEE_SECRET_PASSPHRASE" \
--output $HOME/.config/earthengine/data.colec.fbf/[email protected] ./tests/credentials/[email protected]
--output $HOME/.config/earthengine/ndef/[email protected] ./tests/credentials/[email protected]

gpg --quiet --batch --yes --decrypt --passphrase="$RGEE_SECRET_PASSPHRASE" \
--output $HOME/.config/earthengine/data.colec.fbf/credentials ./tests/credentials/credentials.gpg
--output $HOME/.config/earthengine/ndef/credentials ./tests/credentials/credentials.gpg
60 changes: 25 additions & 35 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,75 +28,65 @@ jobs:
env:
# otherwise remotes::fun() errors cause the build to fail. Example: Unavailability of binaries
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
CRAN: ${{ matrix.config.cran }}
RSPM: ${{ matrix.config.rspm }}
# prevent rgl issues because no X11 display is available
RGL_USE_NULL: true
# macOS >= 10.15.4 linking
SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

steps:
- name: CHECKOUT CODE
uses: actions/checkout@v2

- name: SETUP PYTHON
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v1
with:
python-version: 3.6

- name: SETUP R
uses: r-lib/actions/setup-r@master
python-version: '3.6'
architecture: 'x64'
- uses: r-lib/actions/setup-r@master
with:
r-version: ${{ matrix.config.r }}

- name: SETUP PANDOC
uses: r-lib/actions/setup-pandoc@master
- uses: r-lib/actions/setup-pandoc@master

- name: FIND ALL R PACKAGES DEPENDECIES OF RGEE
- name: Query dependencies
run: |
install.packages('remotes')
install.packages('knitr')
install.packages('pillar') # winbug
install.packages('vctrs')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
shell: Rscript {0}

- name: RETICULATE_PYTHON SETTING
- name: Install Python dependencies
if: runner.os == 'Windows'
run: |
reticulate_dir <- path.expand("~/.Renviron")
fileConn <- file(reticulate_dir)
pyPATH <- Sys.getenv("pythonLocation")
writeLines(sprintf('RETICULATE_PYTHON="%s"', pyPATH), fileConn)
close(fileConn)
shell: Rscript {0}

- name: INSTALL PYTHON DEPENDENCIES
run: |
pip install --upgrade pip
pip install setuptools oauth2client earthengine-api numpy virtualenv
- name: CACHE R PACKAGES [LINUX and macOS]
%PYTHON%\\python.exe -m pip install setuptools numpy earthengine-api
- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-

- name: PREBUILD TESTING
- name: Install system dependencies
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
earthengine -h
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
- name: INSTALL dependencies and rcmdcheck
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: CHECK
- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", "--no-examples"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: UPLOAD CHECK RESULTS
- name: Upload check results
if: failure()
uses: actions/upload-artifact@master
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
run: |
earthengine -h
ls $HOME/.config/earthengine/
ls $HOME/.config/earthengine/data.colec.fbf
ls $HOME/.config/earthengine/ndef
- name: INSTALL rgdal WITH CONFIGURE
Expand Down
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: rgee
Title: R Bindings for Calling the 'Earth Engine' API
Version: 0.6.2
Version: 1.0.0
Authors@R:
c(person(given = "Cesar",
family = "Aybar",
Expand Down Expand Up @@ -75,14 +75,14 @@ Authors@R:
comment = "Appel reviewed the package for JOSS, see
https://github.com/openjournals/joss-reviews/issues/2272"))
Description: Earth Engine <https://earthengine.google.com/> client library for R. All of the 'Earth Engine' API classes,
modules, and functions are made available. Additional functions implemented include importing (exporting) of R (Earth Engine)
modules, and functions are made available. Additional functions implemented include importing (exporting) of Earth Engine
spatial objects, extraction of time series, interactive map display, assets management interface, and metadata display.
See <https://r-spatial.github.io/rgee/> for further details.
License: Apache License (>= 2.0)
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.0
RoxygenNote: 7.1.1
Depends:
R (>= 3.3.0)
Imports:
Expand Down
4 changes: 3 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ S3method(ee_print,ee.featurecollection.FeatureCollection)
S3method(ee_print,ee.geometry.Geometry)
S3method(ee_print,ee.image.Image)
S3method(ee_print,ee.imagecollection.ImageCollection)
S3method(print,ee.computedobject.ComputedObject)
export("%>%")
export(Map)
export(ee)
Expand All @@ -24,6 +25,7 @@ export(ee_clean_pyenv)
export(ee_drive_to_local)
export(ee_extract)
export(ee_gcs_to_local)
export(ee_get)
export(ee_get_assethome)
export(ee_get_date_ic)
export(ee_get_date_img)
Expand Down Expand Up @@ -75,12 +77,12 @@ export(eedate_to_rdate)
export(gcs_to_ee_image)
export(gcs_to_ee_table)
export(local_to_gcs)
export(print.ee.computedobject.ComputedObject)
export(raster_as_ee)
export(rdate_to_eedate)
export(sf_as_ee)
export(stars_as_ee)
exportClasses(EarthEngineMap)
exportClasses(mapview)
importFrom(cli,cat_line)
importFrom(cli,rule)
importFrom(cli,symbol)
Expand Down
34 changes: 32 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,47 @@ vignette: >
%\VignetteIndexEntry{NEWS}
%\VignetteEncoding{UTF-8}
---
# rgee 1.0.0
- We implement `ee_createAssetHome` to help users to define their *Earth Engine Assets home root folder* without leaving ee_Initialize(). (#70 Thanks @jhollist)
- Fix a bug in `ee_Initialize(drive = TRUE, gcs = TRUE)` which do not permit users save credentials. (#72 Thanks @appelmar).
- Removed `check_ring_dir` argument from `sf_as_ee`. Now `rgee` expect that users fix potential geometry problems before upload geometries to their Earth Engine assets.
- Changes in "welcome to rgee" message (located in `ee_Initialize`). We delete `stop("Initialization aborted")` and implement `ee_search_init_message`. It will permit to `rgee` to know if the user accepted to create the global var "EARTHENGINE_INIT_MESSAGE" without need to restart the R session.
- Fix minor bugs in `sf_as_ee` and `gcs_to_ee_table`. The argument `command_line_tool_path` was added to give users the option to set the path of the Earth Engine command linetool. This new argument is only relevant to upload files using Google Cloud Storage. New diagnostic message were added.
- Now `sf_as_ee` returns an `ee$Geometry$...` when `x` is a `sfg` or a single sfc object. If `x` is a sf or a `sfc` object with multiple geometries will return an `ee$FeatureCollection`. New unit test for `sf_as_ee`.
- Changes in the documentation of `ee_as_stars` and `ee_as_raster` (#72 Thanks @appelmar).
- Fix minor bugs in `raster_as_ee`, `stars_as_ee` and `gcs_to_ee_image`. The argument `command_line_tool_path` was added to give users the option to set the path of the Earth Engine command linetool. New diagnostic message were added. New unit test added.
- Fixed a bug in `stars_as_ee` that didn't allow to read single-band images.
- `ee_manage_asset_access` has a better approach to determine the user owner of the asset.
- Add a new logical argument called 'strict' to `ee_manage_assetlist`, `ee_manage_copy`,
`ee_manage_move`, `ee_manage_set_properties` and `ee_manage_delete_properties`. If TRUE,
the existence of the asset will be evaluate before to perform the task. By default TRUE.
- If the `path_asset` is not specified in `ee_manage_assetlist`, rgee will assume that the
path_asset is `ee_get_assethome`.
- `raster_as_ee.R` was created in the /R folder to maintain an order between functions
to upload and download images.
- Fix a bug in the documentation of `print.ee.computedobject.ComputedObject()` (#72 Thanks @appelmar).
- Fix a bug in `ee_install_set_pyenv` now users can set `py_path` without set
`py_env` and vice versa.
- `ee_extract` was adapted to work well with changes in `sf_as_ee`.
- R CMD check is more friendly with users, the use of `--run-dontrun` is also
available (#72 Thanks @appelmar).
- Fix a bug in `ee_get_date_ic`.
- `Map$addLayer` now could display a legend when `eeObject` is an one-band `ee$Image` (By default legend = TRUE).
- New function `ee_get`: Return the element at the specified position in a Earth Engine Collection.
- New function `Map$addLayers`: Create interactive visualizations of ImageCollections.
- - Earth Engine Python API updated to 0.1.227.

# rgee 0.6.2
- Earth Engine Python API updated to 0.1.226.
- Fix some typos.
- Fix a minor bug in ee_monitoring.
- Users can mix mapview and EarthEnginemap objects in the same pipeline (see Examples in `Map$addLayer`).
- Add `ee_as_mapview`, a function to convert `EarthEnginemap` objects to `mapview` objects.
- add a new logical argument called 'strict' to **ee_manage_delete**. If TRUE, the existence of the asset will be evaluate before to perform the task.
- Fix a bug en ee_Initialize, now users without an Earth Engine Assets home root will see a message error.
- Fix a bug in ee_Initialize, now users without an Earth Engine Assets home root will see a message.
- Fix a minor bug when ee_Initialize change of user, now before to change of user the GCS and GD credentials will be deleted.
- ee_check completely renovated.
- New message display.
- New diagnostic messages.
- Fix a minor bug when testing GCS credentials.
- The file ee_check.py was deleted.
- Roy Samapriya added as a contributor.
Expand Down
12 changes: 12 additions & 0 deletions R/AAAMapclass.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ setClass('EarthEngineMap',
map = 'ANY'))
NULL

#' Class mapview
#'
#' @slot object the spatial object
#' @slot map the leaflet map object
#'
#' @exportClass mapview
setClass('mapview',
slots = c(object = 'list',
map = 'ANY'))
NULL


if ( !isGeneric('EarthEngineMap') ) {
setGeneric('EarthEngineMap', function(x, ...)
standardGeneric('EarthEngineMap'))
Expand Down
Loading

0 comments on commit b9d7601

Please sign in to comment.