Skip to content
This repository was archived by the owner on Oct 28, 2019. It is now read-only.

Commit cba95d0

Browse files
committed
Merge branch 'dev'
* dev: Bump version to 0.2.13 Code indenting Fix typo in check if exportenv is loaded #117 Refactor code for readability. Add warning if packages didn't copy correctly. #107
2 parents 86600cd + 57a3572 commit cba95d0

File tree

5 files changed

+73
-23
lines changed

5 files changed

+73
-23
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Title: Interface with Azure Machine Learning Datasets, Experiments and Web Servi
44
Description: Functions and datasets to support Azure Machine Learning. This
55
allows you to interact with datasets, as well as publish and consume R functions
66
as API services.
7-
Version: 0.2.12
8-
Date: 2016-07-13
7+
Version: 0.2.13
8+
Date: 2016-08-19
99
Authors@R: c(
1010
person("Andrie", "de Vries", role=c("aut", "cre"), email="[email protected]"),
1111
person(family="Microsoft Corporation", role="cph"),

NEWS

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
AzureML v0.2.13
2+
---------------
3+
4+
Fixes:
5+
6+
* Fixes a bug that lead to a memory leak on the AzureML web service during consume(). Load exportenv only once (during first call) # 117
7+
8+
9+
AzureML v0.2.12
10+
---------------
11+
12+
This version was released to CRAN on 2017-07-12
13+
14+
Fixes:
15+
16+
* Upload packages from a local repository using `publishWebservice()` #109
17+
18+
Enhancements
19+
20+
* Produce more informative error messages from consume() (#57)
21+
* Better documentation and examples for endpoint settings, especially for regional AML instances (#105)
22+
23+
This version also contains many other internal improvements that probably won't be visible to most users
24+
25+
26+
AzureML v0.2.11 Bug fix and refactor release
27+
---------------
28+
29+
This release fixes multiple internal issues:
30+
31+
* Add additional skip logic to skip tests on CRAN and if no Internet connection tests (#114)
32+
* Fix unit tests and code for download.datasets() to deal with multiple datasets bug tests (#111)
33+
* Upload packages from a local repository using `publishWebservice()` enhancement (#109)
34+
* Missing workspace parameter on download.datasets() leads to cryptic error message bug (#93)
35+
* Fix bug where example for download.datasets() doesn't work (#104)
36+
37+
38+

R/internal.R

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ zipNotAvailableMessage = "Requires external zip utility. Please install zip, ens
164164
#' @importFrom base64enc base64encode
165165
#' @importFrom miniCRAN makeRepo pkgDep
166166
# @keywords Internal
167-
packageEnv <- function(exportenv = new.env(), packages=NULL, version = "3.1.0") {
167+
packageEnv <- function(exportenv = new.env(), packages=NULL, version = getOption("default_r_version")) {
168168
if(!zipAvailable()) stop(zipNotAvailableMessage)
169169

170170
if(!is.null(packages)) assign("..packages", packages, envir = exportenv)
@@ -181,20 +181,31 @@ packageEnv <- function(exportenv = new.env(), packages=NULL, version = "3.1.0")
181181
# Package up dependencies
182182
if(!is.null(packages))
183183
{
184-
re = getOption("repos")
185-
if(is.null(re)) re = c(CRAN = "http://cran.revolutionanalytics.com")
186-
tp = file.path(td,"packages", fsep = "/")
184+
re <- getOption("repos")
185+
if(is.null(re)){
186+
re <- c(CRAN = "http://cran.revolutionanalytics.com")
187+
}
188+
tp <- normalizePath(file.path(td, "packages"), winslash = "/", mustWork = FALSE)
187189
tryCatch(dir.create(tp), warning = function(e) stop(e))
188-
tryCatch(makeRepo(pkgDep(packages,
189-
repos = re,
190-
type = "win.binary",
191-
Rversion = version,
192-
suggests = FALSE),
193-
path = tp,
194-
repos = re,
195-
type = "win.binary",
196-
Rversion = version),
197-
error=function(e) stop(e))
190+
all_p <- pkgDep(packages,
191+
repos = re,
192+
type = "win.binary",
193+
Rversion = version,
194+
suggests = FALSE
195+
)
196+
tryCatch(
197+
z <- makeRepo(all_p,
198+
path = tp,
199+
repos = re,
200+
type = "win.binary",
201+
Rversion = version
202+
),
203+
error=function(e) stop(e)
204+
)
205+
if(!all(grepl(tp, z))) {
206+
warning("Packages did not copy properly in to AzureML. Please ensure you have miniCRAN v0.2.7 or above installed.")
207+
}
208+
z
198209
}
199210

200211
z = try({

R/publish.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ publishWebService <- function(ws, fun, name,
133133
}
134134

135135
}
136-
136+
137137
### Get and encode the dependencies
138138

139139
if(missing(packages)) packages=NULL

R/wrapper.R

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@
3131
### --- Do not remove this uncommented code ------------------------------------
3232

3333
# wrapperFunction <- function(){
34-
# inputDF <- maml.mapInputPort(1)
3534
#
36-
# if(!is.element("exportenv ",search())) {
35+
# inputDF <- maml.mapInputPort(1)
36+
#
37+
# if(!is.element("exportenv", search())) {
3738
# load('src/env.RData')
3839
# if(!is.null(exportenv$..packages)) {
3940
# lapply(exportenv$..packages, function(pkg){
@@ -48,10 +49,10 @@
4849
# quietly = TRUE, character.only=TRUE)
4950
# }
5051
# parent.env(exportenv) = globalenv()
51-
#
52+
#
5253
# attach(exportenv, warn.conflicts = FALSE)
5354
# }
54-
#
55+
#
5556
# if(..data.frame){
5657
# outputDF <- as.data.frame(..fun(inputDF))
5758
# colnames(outputDF) <- ..output_names
@@ -62,7 +63,7 @@
6263
# outputDF <- as.data.frame(outputDF)
6364
# names(outputDF) <- ..output_names
6465
# for(i in 1:nrow(inputDF)){
65-
# outputDF[i, ] <- do.call('..fun', inputDF[i, ])
66+
# outputDF[i, ] <- do.call(..fun, inputDF[i, ])
6667
# }
6768
# }
6869
# maml.mapOutputPort("outputDF")
@@ -73,7 +74,7 @@
7374

7475
### --- End of Do not remove ---------------------------------------------------
7576

76-
wrapper <- "inputDF <- maml.mapInputPort(1)\nif (!is.element(\"exportenv \", search())) {\n load(\"src/env.RData\")\n if (!is.null(exportenv$..packages)) {\n lapply(exportenv$..packages, function(pkg) {\n if (!require(pkg, character.only = TRUE, quietly = TRUE)) \n install.packages(pkg, repos = paste0(\"file:///\", getwd(), \"/src/packages\"), lib = getwd())\n })\n .libPaths(new = getwd())\n lapply(exportenv$..packages, require, quietly = TRUE, character.only = TRUE)\n }\n parent.env(exportenv) = globalenv()\n attach(exportenv, warn.conflicts = FALSE)\n}\nif (..data.frame) {\n outputDF <- as.data.frame(..fun(inputDF))\n colnames(outputDF) <- ..output_names\n} else {\n outputDF <- matrix(nrow = nrow(inputDF), ncol = length(..output_names))\n outputDF <- as.data.frame(outputDF)\n names(outputDF) <- ..output_names\n for (i in 1:nrow(inputDF)) {\n outputDF[i, ] <- do.call(\"..fun\", inputDF[i, ])\n }\n}\nmaml.mapOutputPort(\"outputDF\")"
77+
wrapper <- "inputDF <- maml.mapInputPort(1)\nif (!is.element(\"exportenv\", search())) {\n load(\"src/env.RData\")\n if (!is.null(exportenv$..packages)) {\n lapply(exportenv$..packages, function(pkg) {\n if (!require(pkg, character.only = TRUE, quietly = TRUE)) \n install.packages(pkg, repos = paste0(\"file:///\", getwd(), \"/src/packages\"), lib = getwd())\n })\n .libPaths(new = getwd())\n lapply(exportenv$..packages, require, quietly = TRUE, character.only = TRUE)\n }\n parent.env(exportenv) = globalenv()\n attach(exportenv, warn.conflicts = FALSE)\n}\nif (..data.frame) {\n outputDF <- as.data.frame(..fun(inputDF))\n colnames(outputDF) <- ..output_names\n} else {\n outputDF <- matrix(nrow = nrow(inputDF), ncol = length(..output_names))\n outputDF <- as.data.frame(outputDF)\n names(outputDF) <- ..output_names\n for (i in 1:nrow(inputDF)) {\n outputDF[i, ] <- do.call(..fun, inputDF[i, ])\n }\n}\nmaml.mapOutputPort(\"outputDF\")"
7778

7879

7980

0 commit comments

Comments
 (0)