Skip to content

Commit 3af376b

Browse files
committed
rgee 1.1.2
1 parent a864afc commit 3af376b

12 files changed

+21
-170
lines changed

.Rbuildignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@
2121
^test\credentials
2222
^doc$
2323
^Meta$
24-
^tester\.R$
24+
^tester\.R$
25+
^CITATION\.cff$

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: rgee
22
Title: R Bindings for Calling the 'Earth Engine' API
3-
Version: 1.1.1
3+
Version: 1.1.2
44
Authors@R:
55
c(person(given = "Cesar",
66
family = "Aybar",

NAMESPACE

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ S3method(ee_print,ee.image.Image)
99
S3method(ee_print,ee.imagecollection.ImageCollection)
1010
S3method(print,ee.computedobject.ComputedObject)
1111
export("%>%")
12-
export(.__Extra__)
13-
export(.__Extra_module__)
1412
export(Map)
1513
export(R6Map)
1614
export(ee)

NEWS.md

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ vignette: >
1111
%\VignetteIndexEntry{NEWS}
1212
%\VignetteEncoding{UTF-8}
1313
---
14+
# rgee 1.1.2
15+
16+
- Fix an error in 'ee_check' warning message.
17+
- 'ee_extra' Python package is now a submodule of rgeeExtra.
18+
- 'ee_install' typo fixed.
19+
1420
# rgee 1.1.1
1521

1622
- Deprecated.R file deleted.

R/ee_Initialize.R

-33
Original file line numberDiff line numberDiff line change
@@ -259,18 +259,6 @@ ee_Initialize <- function(user = NULL,
259259
ee$ImageCollection$Dataset <- eeDataset_b$ic
260260
ee$Image$Dataset <- eeDataset_b$image
261261

262-
263-
# If Extra module exist add to ee!
264-
tryCatch(
265-
expr = {
266-
ee$Extra <- .__Extra__
267-
ee$`__Extra__` <- .__Extra_module__
268-
},
269-
error = function(e) {
270-
{ee$Extra <- NULL}
271-
}
272-
)
273-
274262
invisible(TRUE)
275263
}
276264

@@ -834,27 +822,6 @@ ee_Dataset_creator <- function(eeDataset) {
834822
list(image = eedataset_img, ic = eedataset_ic, fc = eedataset_fc)
835823
}
836824

837-
838-
#' Exist ee_extra
839-
#' @noRd
840-
eeExtra_exist <- function() {
841-
condition <- reticulate::py_module_available("ee_extra")
842-
if (!condition) {
843-
"Consider installing ee_extra Python package. ee_extra enables"
844-
"the integration between Javascript and rgee. The following functions"
845-
"will not work until you install ee_extra:"
846-
"- rgeeExtra::module()"
847-
"- ee$Extra$*"
848-
"To install ee_extra please try as follow:"
849-
"> ee_install(): To create and set a Python environment with all rgee dependencies."
850-
"> ee_install_upgrade(): Run previously ee_Initialize to set a Python Env."
851-
"> pip3 install ee_extra"
852-
"> conda install ee_xtra"
853-
}
854-
return(condition)
855-
}
856-
857-
858825
#' Testing 403 error in GD
859826
#' @noRd
860827
test_drive_privileges <-function(user) {

R/ee_check.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ ee_check_python_packages <- function(quiet = FALSE) {
109109
sprintf("version used by rgee (%s). You might use:", ee_version()),
110110
"* rgee::ee_install_upgrade()",
111111
sprintf(
112-
"* reticulate::py_install('earthengine-api==%s')",
112+
"* reticulate::py_install('earthengine-api==%s', envname='PUT_HERE_YOUR_PYENV')",
113113
ee_version()
114114
),
115115
sprintf(

R/ee_clean.R

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ ee_clean_credentials <- function(user='not_defined', quiet = FALSE) {
1515
oauth_func_path <- system.file("python/ee_utils.py", package = "rgee")
1616
utils_py <- ee_source_python(oauth_func_path)
1717
ee_path <- ee_utils_py_to_r(utils_py$ee_path())
18-
email_clean <- gsub("@gmail.com", "", user)
18+
user_clean <- gsub("@gmail.com", "", user)
1919

20-
if (email == 'not_defined') {
21-
email_clean <- 'ndef'
20+
if (user == 'not_defined') {
21+
user_clean <- 'ndef'
2222
}
2323

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

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

3838
unlink(x = path_to_delete, recursive = TRUE, force = TRUE)

R/ee_install.R

+4-4
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ ee_install <- function(py_env = "rgee",
224224
)
225225

226226
reticulate::py_install(
227-
packages = c("earthengine-api", "numpy", "ee_extra"),
227+
packages = c("earthengine-api", "numpy"),
228228
envname = rgee_path
229229
)
230230

@@ -455,8 +455,8 @@ ee_install_upgrade <- function(version = NULL,
455455
earthengine_env = Sys.getenv("EARTHENGINE_ENV")) {
456456
if (earthengine_env == "") {
457457
stop(
458-
"ee_install_upgrade needs that global env EARTHENGINE_ENV",
459-
" is defined to work. Run ee_install_set_pyenv(py_env = \"YOUR_ENV\")",
458+
"ee_install_upgrade needs to define EARTHENGINE_ENV.\n",
459+
"Run ee_install_set_pyenv(py_env = \"YOUR_ENV\")",
460460
" to set a Python environment."
461461
)
462462
}
@@ -465,7 +465,7 @@ ee_install_upgrade <- function(version = NULL,
465465
}
466466
reticulate::py_install(
467467
packages = c(sprintf("earthengine-api==%s", version)),
468-
envname = Sys.getenv("EARTHENGINE_ENV")
468+
envname = earthengine_env
469469
)
470470
title <- paste(
471471
"",

R/ee_module.R

-52
Original file line numberDiff line numberDiff line change
@@ -20,55 +20,3 @@
2020
#' }
2121
#' @export
2222
ee <- NULL
23-
24-
25-
#' Extra Earth Engine dictionary
26-
#'
27-
#' Interface to Extra Earth Engine module. Provides access to the top level
28-
#' classes and functions as well as sub-modules (e.g. \code{ee$Image},
29-
#' \code{ee$FeatureCollection$first}, etc.).
30-
#'
31-
#' @format Earth Engine module
32-
#'
33-
#' @examples
34-
#' \dontrun{
35-
#' library(rgee)
36-
#' library(rgeeExtra)
37-
#'
38-
#' # ee_install_extra()
39-
#' ee_Initialize()
40-
#'
41-
#' ee_img1 <- ee$Image(0)
42-
#' ee_img2 <- ee$Image(0)
43-
#'
44-
#' ee_img3 <- ee_img1 * ee_img2 + ee_img2
45-
#' print(ee_img3)
46-
#' }
47-
#' @export
48-
.__Extra__ <- NULL
49-
50-
51-
#' Extra Earth Engine module
52-
#'
53-
#' Interface to Extra Earth Engine module. Provides access to the top level
54-
#' classes and functions as well as sub-modules (e.g. \code{ee$Image},
55-
#' \code{ee$FeatureCollection$first}, etc.).
56-
#'
57-
#' @format Earth Engine module
58-
#'
59-
#' @examples
60-
#' \dontrun{
61-
#' library(rgee)
62-
#' library(rgeeExtra)
63-
#'
64-
#' # ee_install_extra()
65-
#' ee_Initialize()
66-
#'
67-
#' ee_img1 <- ee$Image(0)
68-
#' ee_img2 <- ee$Image(0)
69-
#'
70-
#' ee_img3 <- ee_img1 * ee_img2 + ee_img2
71-
#' print(ee_img3)
72-
#' }
73-
#' @export
74-
.__Extra_module__ <- NULL

R/zzz.R

+2-5
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
# Sys.setenv(RETICULATE_PYTHON = earthengine_python)
1010

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

15-
# delay load eeExtra
16-
.__Extra_module__ <<- reticulate::import("ee_extra", delay_load = list(priority = 40))
17-
.__Extra__ <<- .__Extra_module__$Extra
1815
}

man/dot-__Extra__.Rd

-33
This file was deleted.

man/dot-__Extra_module__.Rd

-33
This file was deleted.

0 commit comments

Comments
 (0)