Contains abstract super class which implements the basic model interface (bmi) in R.
From R
devtools::install_github("eWaterCycle/bmi-r")
The grpc4bmi server can serve models written in R as a grpc service. The grpc service can be consumed by the Python grpc BmiClient.
First the model should be wrapped in a basic model interface be subclassing the AbstractBmi class.
Then install dependencies for running grpc4bmi server:
pip install grpc4bmi[R]
Then the server can be started with:
run-bmi-server --lang R --path <path to r script with bmi class> --name <bmi class name>
So for example for WALRUS model, see its Dockerfile.
The config file for the bmi initialize function should be put in current working directory and the initialize function should be called with /data/<config filename
.
Rscript -e "devtools::document(roclets=c('rd', 'collate', 'namespace'))"
Rscript -e 'devtools::document()'
R CMD INSTALL .