Commit 36fcde08 authored by Romain Reuillon's avatar Romain Reuillon
Browse files

[Plugin] fix: write header once

parent 44dd7857
......@@ -55,11 +55,11 @@ package object sensitivity {
def writeResults(ps: PrintStream, inputs: Seq[Val[_]], outputs: Seq[Val[_]], coefficient: (Val[_], Val[_]) Val[_]) = FromContext { p
import p._
outputs.foreach { o
outputs.zipWithIndex.foreach { case (o, i)
val vs = inputs.map { i coefficient(i, o) }
def headerLine = s"""output,${csv.header(inputs, vs)}"""
csv.writeVariablesToCSV(ps, Some(headerLine), Seq(o.name) ++ vs.map(v context(v)))
val headerLine = if(i == 0) Some(s"""output,${csv.header(inputs, vs)}""") else None
csv.writeVariablesToCSV(ps, headerLine, Seq(o.name) ++ vs.map(v context(v)))
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment