Open
Description
message_data
contains some modules that are partly or entirely in R. For instance:
- The DLE code is entirely in R.
- The Nexus (water) code is partly in Python, but with data processing scripts in R.
This issue is to discuss approaches so that this code (a) can be integrated into complete workflows that run unsupervised, and (b) can be more reusable, in a standard way. The implementation should be in message-ix-models.
Some ideas:
- Provide a CLI command like
mix-models r-script foo/bar/baz
that will simply invoke a file at (e.g.)message_data/foo/bar/baz.R
, while providing some standard environment variables that the script can use to understand paths to data, etc. - Use
rpy2
(with documentation & demo code) in Python code to directly call functions from R code in particular files, and retrieve its output for further processing.