Closed m-muecke closed 4 days ago
I think we should either allow length one vectors or throw a more informative error. Since zero length vectors are allowed I would argue length 1 vectors need to be supported as well.
Agreed. domain then set to the value itself.
does that need "cli_inform" like for the empty prototype as well?
tf::tfd()
#> Input `data` not recognized class; returning prototype of length 0.
#> tfd[0] on (0,0) based on 0 evaluations each
#> interpolation by tf_approx_linear
I think we should either allow length one vectors or throw a more informative error. Since zero length vectors are allowed I would argue length 1 vectors need to be supported as well.
Agreed. domain then set to the value itself.
does that need "cli_inform" like for the empty prototype as well?
tf::tfd() #> Input `data` not recognized class; returning prototype of length 0. #> tfd[0] on (0,0) based on 0 evaluations each #> interpolation by tf_approx_linear
I would argue the message should be removed for empty prototypes, then it also aligns more closely with other packages, furthemore tfb()
also doesn't provide a message for empty prototypes.
alright, good point. let's do that then.
Constructing
tf
andtfb
vectors with length one fail due to the domain assertion, but not for length equal or greater than 2. @fabian-s I think we should either allow length one vectors or throw a more informative error. Since zero length vectors are allowed I would argue length 1 vectors need to be supported as well.Created on 2024-11-10 with reprex v2.1.1