mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-06-08 00:23:09 +00:00
Store compiled model in platform specific location
This commit is contained in:
parent
192b9160a7
commit
6bbac0c47b
2 changed files with 11 additions and 2 deletions
|
|
@ -248,7 +248,11 @@ compile_stan_model <- function() {
|
|||
'You should not see this message more than once after install.'
|
||||
)
|
||||
|
||||
dest <- file.path(path.package("prophet"), 'libs')
|
||||
if (.Platform$OS.type == "windows") {
|
||||
dest <- file.path(path.package("prophet"), 'libs', .Platform$r_arch)
|
||||
} else {
|
||||
dest <- file.path(path.package("prophet"), 'libs')
|
||||
}
|
||||
dir.create(dest, recursive = TRUE, showWarnings = FALSE)
|
||||
|
||||
packageStartupMessage(paste('Writing model to:', dest))
|
||||
|
|
|
|||
|
|
@ -7,8 +7,13 @@
|
|||
# Create environment for storing stan model
|
||||
assign("prophet_model_env", new.env(), parent.env(environment()))
|
||||
tryCatch({
|
||||
if (.Platform$OS.type == "windows") {
|
||||
dest <- file.path('libs', .Platform$r_arch)
|
||||
} else {
|
||||
dest <- 'libs'
|
||||
}
|
||||
binary <- system.file(
|
||||
'libs',
|
||||
dest,
|
||||
'prophet_stan_model.RData',
|
||||
package = 'prophet',
|
||||
mustWork = TRUE
|
||||
|
|
|
|||
Loading…
Reference in a new issue