Fix dead test

This commit is contained in:
Alexander Nozik 2020-08-27 17:06:33 +03:00
parent c83a25b0a1
commit 9361145197

View File

@ -1,5 +1,8 @@
package hep.dataforge.vision.gdml package hep.dataforge.vision.gdml
import hep.dataforge.vision.solid.AbstractProxy
import hep.dataforge.vision.solid.prototype
import hep.dataforge.vision.visitor.countDistinct
import hep.dataforge.vision.visitor.countDistinctBy import hep.dataforge.vision.visitor.countDistinctBy
import hep.dataforge.vision.visitor.flowStatistics import hep.dataforge.vision.visitor.flowStatistics
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
@ -7,6 +10,7 @@ import kotlinx.coroutines.withContext
import nl.adaptivity.xmlutil.StAXReader import nl.adaptivity.xmlutil.StAXReader
import scientifik.gdml.GDML import scientifik.gdml.GDML
import java.io.File import java.io.File
import kotlin.reflect.KClass
suspend fun main() { suspend fun main() {
withContext(Dispatchers.Default) { withContext(Dispatchers.Default) {
@ -19,16 +23,18 @@ suspend fun main() {
val vision = xml.toVision() val vision = xml.toVision()
vision.flowStatistics().countDistinctBy { it.type }.forEach { (depth, size) -> vision.flowStatistics<KClass<*>>{ _, child ->
child.prototype::class
}.countDistinct().forEach { (depth, size) ->
println("$depth\t$size") println("$depth\t$size")
} }
println("***REDUCED***") // println("***REDUCED***")
//
vision.optimizeGdml() // vision.optimizeGdml()
//
vision.flowStatistics().countDistinctBy { it.type }.forEach { (depth, size) -> // vision.flowStatistics().countDistinctBy { it.type }.forEach { (depth, size) ->
println("$depth\t$size") // println("$depth\t$size")
} // }
} }
} }