Open mitchellmanware opened 1 month ago
@mitchellmanware I didn't realize you were getting this external pointer
issue. This could be a targets
issue with returning a terra
object. geotargets
was developed to deal with these C++ external pointer issues. If we are trying to return this a terra SpatVector then try replacing tar_target
with tar_terra_vect
. If the amadeus
function must return an sf
object, then it may be not be related to this.
@mitchellmanware @sigmafelix
Looking at it more closely the error Error: external pointer is not valid
is the exact error that geotargets
says it is designed to handle. Hopefully replacing with tar_terra_vect
will resolve it.
You may have to update and rerun the .def file. I found that the suggested install for geotargets
was failing on the container build and that the approach to install that worked was Rscript -e "devtools::install_github('njtierney/geotargets')"
@kyle-messier @mitchellmanware Pointer errors are from terra
objects that are exported to parallel workers, which is not allowed in mirai
daemons. geotargets
way of resolving this problem is feasible only when each dataset that should be marshaled/unmarshaled is in a manageable size (e.g., several hundred MBs). Instead, I think we may try emulate "lazy" way of calculation where we pass the file paths to each parallel worker (i.e., branched targets) then functions there will actually process and calculate targets. That said, no terra
objects are generated or transferred in the outer target, rather a branch is self-contained with internal terra
processing parts and file paths (character
vector/list).
@sigmafelix That makes sense. I'll give it a try.
@sigmafelix @kyle-messier I am receiving errors when calculating ecoregion covariates from within our container.
When I directly call the
amadeus::*_ecoregions
functions in two separate targets, theprocess_ecoregion
performs as expected, but thecalc_ecoregions
returns a pointer-related issueWhen I use the functions together, I am getting an error related to mismatched rows.
Could this be related to the fixation on Tukey's bridge, which was previously discussed in https://github.com/NIEHS/beethoven/issues/211?