Closed soniamitchell closed 2 years ago
name
is the actual name of the function as a string. assert_no_globals()
tries to infer that cleverly by deparsing the argument, but it doesn't always work (if you are passing a function through run_simulation()
for instance), so you have to do it by hand. I'm happy to pass in a string if you know how to "call" a string, though then it would only work if the string was a function in the global namespace I guess?
~> name
is the actual name of the function as a string.~
~I realise that, but I don't understand why it's an argument since it's only used in the error message.~
I know how to call a function by its name, but before we do that, we should discuss https://github.com/IBAHCM/RPiR/projects/1#card-54492873
I realise you've deleted it, but the whole point of the function is to generate the error message, so that makes it useful. As far as the card above is concerned, we should turn it into an issue, because I can't comment on it, but for me (a) devtools::check()
is terrifying! and (b) people do find global variables in their functions all the time. I wish there was something built-in we could use that was less scary...
Yea, I didn't read this bit properly
but it doesn't always work (if you are passing a function through run_simulation() for instance), so you have to do it by hand
hence the deletion.
I thought we agreed to put suggestions on the project board as notes, rather than making them issues? – I can't remember why. I've converted the card to an issue.
We did just to get them up there quickly, but there's no reason not to convert them to issues.
Yea, I converted them all into issues (and added a few more) a few days ago 👍
expended documentation
name
argument for?test_function
the function name as a string should be allowed as an input (or the function should be better documented and return a more informative error)