Commit da8dff25 authored by Romain Reuillon's avatar Romain Reuillon
Browse files

[Plugin] fix: test

parent 56919735
Pipeline #1215 failed with stages
in 36 minutes and 36 seconds
......@@ -20,6 +20,10 @@ package org.openmole.core.workflow.sampling
import org.openmole.core.context._
import org.openmole.core.expansion._
object Sampling {
implicit def fromIsSampling[T](t: T)(implicit isSampling: IsSampling[T]) = isSampling(t)
}
case class Sampling(
sampling: FromContext[Iterator[Iterable[Variable[_]]]],
outputs: Iterable[Val[_]],
......
......@@ -38,8 +38,6 @@ package sampling {
implicit def fromContextIsDiscrete[T]: DiscreteFromContextDomain[FromContext[T], T] = domain Domain(domain.map(v Vector(v).iterator))
implicit def fromIsSampling[T](t: T)(implicit isSampling: IsSampling[T]) = isSampling(t)
implicit def factorIsSampling[D, T](implicit domain: DiscreteFromContextDomain[D, T]): IsSampling[Factor[D, T]] = f => {
def inputs = {
val domainValue = domain(f.domain)
......
......@@ -28,14 +28,19 @@ class ModifierDomainSpec extends FlatSpec with Matchers {
"inputs of modified domain" should "be as expected" in {
val size = Val[Int]
val range = RangeDomain[Int](0, 10)
val range = RangeDomain[Int](0, 10).step(1)
val take = range.take(size)
implicitly[domain.DomainInput[take.type]].apply(take) should contain(size)
TakeDomain.isDiscrete(take).inputs should contain(size)
}
"range" should "work with modifiers" in {
RangeDomain[Double](0.0, 10.0, 0.1).map(x x * x)
RangeDomain[Int](0, 10).map(x x * x)
val range = RangeDomain[Int](0, 10).step(1)
val take = range.take(10)
val t = Val[Int]
val sampling: Sampling = t in take
}
"files" should "work with modifiers" in {
......
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