-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getMadratGraph() returns false negatives on valid code #92
Comments
Ahh thanks for looking into this Michaja. The quick fix (on the calcGDPppp side) would be then to simply put GDP between quotes in the warning message right? |
No, because then would For a better solution in madrat: I am not sure how to properly detect that in this case it is actually not code but just text |
Ah ok, thanks for the explanation. I will rewrite the warning message. |
You can also just hide the - warning("calcGDPppp() is deprecated. Returning default 'calcOutput(GDP)' output instead. Please use mrdriv>
+ warning("calcGDPppp() is deprecated. Returning default 'calc", "Output(GDP)' output instead. Please use mrdrivers::calcGDP() directly.") |
Bad news: you are trying to do the impossible – parsing code using a stateless machine. |
This regular expression
madrat/R/getMadratGraph.R
Line 40 in d976b88
fails to see that
calcOutput(GDP)
is valid R code (as long asGDP
is defined, which it does not check).This leads to false negative warnings for https://github.com/pik-piam/mrcommons/blob/0041fd9d6e6a7e564f7ea10804e31523dec8d792/R/calcGDPppp.R#L20
which is not code but a string too boot.
The text was updated successfully, but these errors were encountered: