简体   繁体   English

在全局环境中定义默认缓存 drake

[英]Define default cache drake in global environment

i have a drake plan and intend to switch the cache directory based on the input data (ie input-dir1 -> results-dir1).我有一个 drake 计划,打算根据输入数据(即 input-dir1 -> results-dir1)切换缓存目录。 This has the advantage, that I don't need to rerun the full pipeline, if the data source switches.这样做的好处是,如果数据源切换,我不需要重新运行完整的管道。

Functions like make or loadd seem to always use find_cache , which defaults to the .drake dir in the current R workspace. makeloadd类的函数似乎总是使用find_cache ,它默认为当前 R 工作区中的.drake目录。

Is there a way to define an default cache in the current global environment that is not in the .drake dir?有没有办法在当前全局环境中定义一个不在 .drake 目录中的默认缓存? I would like avoid to define the cache manually in every call to make , clean , or loadd via the parameter cache .我想避免在每次调用makeclean或通过参数cache loadd手动定义cache

Thanks谢谢

Cache switching is uncommon, and it usually increases brittleness and decreases reproducibility.缓存切换并不常见,它通常会增加脆弱性并降低可重复性。 So I usually discourage it and have no plans to implement a global setting to set the cache.所以我通常不鼓励它并且没有计划实施全局设置来设置缓存。 In your case, you can set your own global option or environment variable and supply it to the cache argument.在您的情况下,您可以设置自己的全局选项或环境变量并将其提供给cache参数。 There are ways to change the default value of cache , but please be careful.多种方法可以更改cache的默认值,但请小心。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM