Open vgherard opened 3 years ago
In the first call, autotest::autotest_package(package = "kgrams")
, the error occurs in autotest:::get_fn_exs()
, which gets called from autotest::examples_to_yaml()
with the following arguments:
library(kgrams)
package <- "kgrams"
rdname <- "preprocess"
topic <- "preprocess"
is_source <- FALSE
autotest:::get_fn_exs(package, rdname, topic, is_source)
#> Error in qstart[i]:qend[i]: Argomento NA/NaN
Created on 2021-07-16 by the reprex package (v2.0.0)
If you jump in the debugger and see how the code of the first example is preprocessed, you will notice that the output after preprocessing is invalid R code.
Hope this helps
@vgherard Thanks for this one - this particular :bug: is definitely internal to autotest
, and not to kmeans
. As mentioned in #48, the entire procedure to identify input types is going to be restructured to avoid current hand-parsing of example code. The bunch of commits above partially address the bugs this revealed, but a real solution won't really be possible until the restructure. Those commits get us up to encountering the %|%
symbol which indeed crashes everything here, and is unable to be resolved with autotest
designed as it current is. Examples are all converted to yaml
form, and parsing characters like that requires hand re-coding for each new one encountered, which is obviously not sustainable. The re-design will avoid the need for manual parsing, for which this package will provide a great test case, so thanks! I'll leave this issue open, and you'll hopefully see results here.
I'll leave this issue open, and use this package as a test cast for the re-design. Thanks!
Thank you @mpadge, looking forward for the next version then :smiley:. If I can help in any way, let me know!
Hi @vgherard, just letting you know that I'm finally get back to these issues, if you're still interested. I'll leave both this one and #48 open to test the new approach with once it gets that far. Sorry for any inconvenience.
Here I'm trying
autotest::autotest_package()
onkgrams
(I'm using here the CRAN version for ease of reproducibility). It looks like it is failing to convert some of my examples to YAML, but the errors are somewhat cryptic. Might these be due to the fact that some of my examples contain infix operators (e.g.%|%
)? I recall having some problems also withpkgdown
for this reason.I will try to jump into the debugger to catch the culprit example(s?). Meanwhile, any idea on this?
Thanks, Valerio
Created on 2021-07-16 by the reprex package (v2.0.0)