pecan
pecan copied to clipboard
Remove Settings as Global Variable
This pull tries to fix the issue of 'Settings' being used as Global variable. This is done by creating a local variable 'Settings' and passing that as function argument as required (here in convert.input.R).
I am not sure if this approach is correct. I thought making 'Settings' local and using that should be a work around.
I think this is the line that needs changing: https://github.com/PecanProject/pecan/blob/cd3e4c2dc1739b4165574dd1200f73886d80af9a/base/utils/R/convert.input.R#L100
exists()
looks for an R object in the global environment. Looks like it could probably be replaced with something like
Rbinary <- settings$host$Rbinary
if(is.null(Rbinary)) Rbinary <- "R"
@Aariq @mdietze Based on your suggestions, this is what I came up with.
/document
@its-Maniaco Please also add a Roxygen documentation string for the new Rbinary
parameter by adding the followin between current lines 57 and 58 of base/utils/R/convert.input.R
:
##' @param Rbinary command (including path, if needed) to call the R executable on `host`
@Its-Maniaco I took the liberty of working up a patch that implements the "read from host list" approach we recommended in the comments above. If you review and merge https://github.com/Its-Maniaco/pecan/pull/1 (note that it's a pull request in your fork of PEcAn, not in the PecanProject upstream that I'm typing this comment inside), my changes should immediately show up here... and if I did it right, this here PR should switch to showing only two files changed instead of 12.