Skip to content

Commit

Permalink
Important fix for saving storage on save. Define env on function in p…
Browse files Browse the repository at this point in the history
…aram
  • Loading branch information
Rafnuss committed Jan 17, 2024
1 parent 8255eab commit 9bcbf79
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/geolight_map.R
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ geolight_map <- function(tag,
type = "light"
)

attr(twl_llp, "srcref") <- NULL
attr(twl_llp, "srcfile") <- NULL
environment(twl_llp) <- baseenv()

# Add parameters
tag$param$twl_calib_adjust <- twl_calib_adjust
tag$param$twl_llp <- twl_llp
Expand Down
3 changes: 3 additions & 0 deletions R/geopressure_map_likelihood.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ geopressure_map_likelihood <- function(tag,
)

tag$param$sd <- sd0
attr(log_linear_pooling_weight, "srcref") <- NULL
attr(log_linear_pooling_weight, "srcfile") <- NULL
environment(log_linear_pooling_weight) <- baseenv()
tag$param$log_linear_pooling_weight <- log_linear_pooling_weight
attr(tag$param$log_linear_pooling_weight, "srcref") <- NULL

Expand Down
3 changes: 3 additions & 0 deletions R/graph_add_wind.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ graph_add_wind <- function(
graph$gs <- graph$gs[id]
graph$ws <- graph$ws[id]
graph$param$thr_as <- thr_as
attr(file, "srcref") <- NULL
attr(file, "srcfile") <- NULL
environment(file) <- baseenv()
graph$param$wind_file <- file

return(graph)
Expand Down
4 changes: 4 additions & 0 deletions R/graph_set_movement.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ graph_set_movement <- function(graph,
assertthat::assert_that(inherits(bird, "bird"))
assertthat::assert_that(is.function(power2prob))
mvt$bird <- bird

attr(power2prob, "srcref") <- NULL
attr(power2prob, "srcfile") <- NULL
environment(power2prob) <- baseenv()
mvt$power2prob <- power2prob
}

Expand Down

0 comments on commit 9bcbf79

Please sign in to comment.