Skip to content
This repository was archived by the owner on May 11, 2020. It is now read-only.

Commit

Permalink
RESOLVED - issue ALESIA-9: Fix TestReport test of SESSL's JAMESII bin…
Browse files Browse the repository at this point in the history
…ding

https://altair.informatik.uni-rostock.de/jira/browse/ALESIA-9
simplified and fixed reporting of multiple named trajectory tuples (e.g. as returned by results.all).
(grafted from b0092a80df125f922a3aaccdf303ad2d64535cf7)
  • Loading branch information
Roland Ewald committed Jul 31, 2013
1 parent faabc04 commit 990365d
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions sessl/src/main/scala/sessl/AbstractReport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ trait AbstractReport extends ExperimentConfiguration {
/** The section to be currently filled with content. */
private var currentSection: ReportSection = rootSection

/** Defines a new report section.
/**
* Defines a new report section.
* @param name the name of the section
* @param description the description of the section (default: empty)
* @param contentSpecification the function defining the content of the section
Expand Down Expand Up @@ -149,7 +150,17 @@ trait AbstractReport extends ExperimentConfiguration {
/** Converts data items to a common format that can be used for line plots. */
private[this] def convertToLinePlotData(data: Iterable[Any]): Seq[(String, Iterable[_])] = data.head match {
case tuple: (_, _) => ("Time", tuple._2.asInstanceOf[Trajectory].map(_._1)) :: data.toList.flatMap(toNamedList)
case trajectory: Iterable[_] => ("Time", trajectory.asInstanceOf[Trajectory].map(_._1)) :: data.toList.flatMap(toNamedList)
case multipleData: Iterable[_] => multipleData.head match {
case tuple: (_, _) =>
tuple._1 match {
case s: String => {
require(data.size == 1, "Expecting just another nesting layer if data does not consist of (name, trajectory) tuples.")
convertToLinePlotData(multipleData)
}
case _ => throw new IllegalArgumentException
}
case _ => throw new IllegalArgumentException
}
case _ => data.toList.flatMap(toNamedList)
}

Expand Down

0 comments on commit 990365d

Please sign in to comment.