AvgCat computes average across all runs
(files []string)
| 108 | |
| 109 | // AvgCat computes average across all runs |
| 110 | func AvgCat(files []string) { |
| 111 | dts := make([]*table.Table, 0, len(files)) |
| 112 | for _, fn := range files { |
| 113 | dt := &table.Table{} |
| 114 | err := dt.OpenCSV(core.Filename(fn), table.Tab) |
| 115 | if err != nil { |
| 116 | fmt.Println("Error opening file: ", err) |
| 117 | continue |
| 118 | } |
| 119 | if dt.Rows == 0 { |
| 120 | fmt.Printf("File %v empty\n", fn) |
| 121 | continue |
| 122 | } |
| 123 | dts = append(dts, dt) |
| 124 | } |
| 125 | if len(dts) == 0 { |
| 126 | fmt.Println("No files or files are empty, exiting") |
| 127 | return |
| 128 | } |
| 129 | avgdt := stats.MeanTables(dts) |
| 130 | avgdt.SetMetaData("precision", strconv.Itoa(LogPrec)) |
| 131 | avgdt.SaveCSV(core.Filename(Output), table.Tab, table.Headers) |
| 132 | } |
| 133 | |
| 134 | // AvgByColumn computes average by given column for given files |
| 135 | // If column is empty, averages across all rows. |
no test coverage detected