Skip to content

Commit

Permalink
Merge branch 'extra_sync'
Browse files Browse the repository at this point in the history
  • Loading branch information
csaybar committed Sep 16, 2021
2 parents a8c09e1 + 3af376b commit c7151c9
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 28 deletions.
3 changes: 2 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@
^test\credentials
^doc$
^Meta$
^tester\.R$
^tester\.R$
^CITATION\.cff$
2 changes: 1 addition & 1 deletion 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: 1.1.1
Version: 1.1.2
Authors@R:
c(person(given = "Cesar",
family = "Aybar",
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ vignette: >
%\VignetteIndexEntry{NEWS}
%\VignetteEncoding{UTF-8}
---
# rgee 1.1.2

- Fix an error in 'ee_check' warning message.
- 'ee_extra' Python package is now a submodule of rgeeExtra.
- 'ee_install' typo fixed.

# rgee 1.1.1

- Deprecated.R file deleted.
Expand Down
1 change: 0 additions & 1 deletion R/addins.R
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,3 @@ ee_get_eefunc <- function() {
ee_get_funname(text = context$contents[line], cursor = cursor)
}
}

14 changes: 0 additions & 14 deletions R/ee_Initialize.R
Original file line number Diff line number Diff line change
Expand Up @@ -259,18 +259,6 @@ ee_Initialize <- function(user = NULL,
ee$ImageCollection$Dataset <- eeDataset_b$ic
ee$Image$Dataset <- eeDataset_b$image


# If Extra module exist add to ee!
tryCatch(
expr = {
class(Extra) <- c("Extra_EE_module", class(Extra))
ee$Extra <- Extra
},
error = function(e) {
{ee$Extra <- NULL}
}
)

invisible(TRUE)
}

Expand Down Expand Up @@ -825,7 +813,6 @@ ee_check_packages <- function(fn_name, packages) {
}
}


#' Dataset Creator
#' @noRd
ee_Dataset_creator <- function(eeDataset) {
Expand All @@ -835,7 +822,6 @@ ee_Dataset_creator <- function(eeDataset) {
list(image = eedataset_img, ic = eedataset_ic, fc = eedataset_fc)
}


#' Testing 403 error in GD
#' @noRd
test_drive_privileges <-function(user) {
Expand Down
2 changes: 1 addition & 1 deletion R/ee_check.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ ee_check_python_packages <- function(quiet = FALSE) {
sprintf("version used by rgee (%s). You might use:", ee_version()),
"* rgee::ee_install_upgrade()",
sprintf(
"* reticulate::py_install('earthengine-api==%s')",
"* reticulate::py_install('earthengine-api==%s', envname='PUT_HERE_YOUR_PYENV')",
ee_version()
),
sprintf(
Expand Down
10 changes: 5 additions & 5 deletions R/ee_clean.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ ee_clean_credentials <- function(user='not_defined', quiet = FALSE) {
oauth_func_path <- system.file("python/ee_utils.py", package = "rgee")
utils_py <- ee_source_python(oauth_func_path)
ee_path <- ee_utils_py_to_r(utils_py$ee_path())
email_clean <- gsub("@gmail.com", "", user)
user_clean <- gsub("@gmail.com", "", user)

if (email == 'not_defined') {
email_clean <- 'ndef'
if (user == 'not_defined') {
user_clean <- 'ndef'
}

path_to_delete <- sprintf("%s/%s", ee_path, email_clean)
path_to_delete <- sprintf("%s/%s", ee_path, user_clean)

if (!dir.exists(path_to_delete)) {
if (!quiet) {
Expand All @@ -32,7 +32,7 @@ ee_clean_credentials <- function(user='not_defined', quiet = FALSE) {
if (!quiet && dir.exists(path_to_delete)) {
cat(
sprintf("Credentials in %s has been deleted.\n",
sprintf("%s/%s", ee_path, email_clean)))
sprintf("%s/%s", ee_path, user_clean)))
}

unlink(x = path_to_delete, recursive = TRUE, force = TRUE)
Expand Down
6 changes: 3 additions & 3 deletions R/ee_install.R
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,8 @@ ee_install_upgrade <- function(version = NULL,
earthengine_env = Sys.getenv("EARTHENGINE_ENV")) {
if (earthengine_env == "") {
stop(
"ee_install_upgrade needs that global env EARTHENGINE_ENV",
" is defined to work. Run ee_install_set_pyenv(py_env = \"YOUR_ENV\")",
"ee_install_upgrade needs to define EARTHENGINE_ENV.\n",
"Run ee_install_set_pyenv(py_env = \"YOUR_ENV\")",
" to set a Python environment."
)
}
Expand All @@ -465,7 +465,7 @@ ee_install_upgrade <- function(version = NULL,
}
reticulate::py_install(
packages = c(sprintf("earthengine-api==%s", version)),
envname = Sys.getenv("EARTHENGINE_ENV")
envname = earthengine_env
)
title <- paste(
"",
Expand Down
5 changes: 3 additions & 2 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# Sys.setenv(RETICULATE_PYTHON = earthengine_python)

# delay load earthengine-api
#ee <<- reticulate::import("ee", delay_load = TRUE)
ee <<- reticulate::import("ee", delay_load = list(priority = 30))
ee <<- reticulate::import("ee", delay_load = TRUE)
#ee <<- reticulate::import("ee", delay_load = list(priority = 30))

}

0 comments on commit c7151c9

Please sign in to comment.