Listing parameters for each operator programmatically
Added by Elio Campitelli 6 months ago
Hi, I'm trying to write an R package to use CDO by generating each operator as an R function. I'm able to generate the functions based on the name of the command, the number of input and output streams and the required or optional parameters. The problem now is how to gather all the information programmatically for the 900+ operators in the current version. I can get IO information from `cdo --operators` and some documentation from the OPERATORS file, but I don't see how to get the parameters information. `cdo -h <operator>` has the information, but it's very hard to parse because is not made to be machine readable and has lots of little inconsistencies.
Any help would be very much appreciated.
Replies (2)
RE: Listing parameters for each operator programmatically - Added by Uwe Schulzweida 6 months ago
Hi Elio,
Sorry, because of the inconsistencies it is not possible to capture the parameter information automatically.
Cheers,
Uwe
RE: Listing parameters for each operator programmatically - Added by Elio Campitelli 6 months ago
Oh, that's shame.
If anyone's interested, here's the repo:
https://github.com/eliocamp/rcdo
I'm doing the best I can. Some parameters are not parsed correctly and for now functions gain all the parameters of their "family" as they are grouped in the documentation. So `cdo_setyear()` has argument `year`, but also `day`, `month`, etc. from the other "set" family of operators.