go(report): handle 'comparison of means' plots
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-08-09 17:16:16 +02:00
parent 805db5088b
commit 37d761bf81
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
2 changed files with 14 additions and 1 deletions

@ -7,6 +7,7 @@ import (
_ "embed"
"log"
"os"
"regexp"
"text/template"
"time"
)
@ -35,8 +36,16 @@ var (
func SaveTexAllPics() {
a := allPics
texAllPicsFile := GetTexDir() + "allpics" + ".tex"
r := regexp.MustCompile(`^Comparison of Algo Means`)
tmplAllPics := template.New("allpics").Funcs(
template.FuncMap{
"isComparison": func(s string) bool {
matches := r.FindAllString(s, -1)
tmplAllPics := template.New("allpics")
return matches != nil
},
},
)
tmplAllPics = template.Must(tmplAllPics.Parse(string(tmplAllPicsFile)))
f, err := os.Create(texAllPicsFile)

@ -9,7 +9,11 @@
\section{Plot comparisons}
{{ range $i, $v := .AllPics.TexFiles }}
{{ if isComparison $v.Algo }}
\section{ {{- $v.Algo -}} }
{{- else -}}
\subsection{ {{- $v.Algo -}} }
{{ end -}}
{{- range $j, $u := $v.FilePaths }}
\input{ {{- printf "{%s}" $u -}} }
\newpage