[codeface] Re: [PATCH 4/5] The ts analysis requires at least 3 revisions

  • From: Wolfgang Mauerer <wm@xxxxxxxxxxxxxxxx>
  • To: codeface@xxxxxxxxxxxxx
  • Date: Mon, 04 Aug 2014 01:52:43 +0200

On 02/08/2014 12:42, Mitchell Joblin wrote:
> - With less than 3 revisions the analysis fails
> 
> - Check this requirement and log error if not satisfied
> 
> Signed-off-by: Mitchell Joblin <mitchell.joblin.ext@xxxxxxxxxxx>
> ---
>  codeface/R/ts_utils.r | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/codeface/R/ts_utils.r b/codeface/R/ts_utils.r
> index 33adebb..bcc11bd 100644
> --- a/codeface/R/ts_utils.r
> +++ b/codeface/R/ts_utils.r
> @@ -85,6 +85,13 @@ compute.release.distance <- function(series.merged, conf) {
>    series <- gen.series(series.merged, "Averaged (large window)")
>    series <- split.by.ranges(series, conf$boundaries)
>  
> +  ## Number of series is equal to (1 - number of revisions) provided
> +  ## by the configuration file
> +  if(length(series) < 2) {
> +    logerror("Less than 3 revisions provided by configuration file",
> +             logger="ts_ulits")
s/ts_ulits/ts_utils/

Any reason to not stop the analysis explicitly after the error is
detected?

Thanks, Wolfgang
> +  }
> +
>    res <- sapply(1:(length(series)-1), function(i) {
>      compute.ts.distance(series[[i]], series[[i+1]])
>    })
> 


Other related posts: