Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
openmole
openmole
Commits
da8dff25
Commit
da8dff25
authored
Jul 30, 2021
by
Romain Reuillon
Browse files
[Plugin] fix: test
parent
56919735
Pipeline
#1215
failed with stages
in 36 minutes and 36 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
openmole/core/org.openmole.core.workflow/src/main/scala/org/openmole/core/workflow/sampling/Sampling.scala
View file @
da8dff25
...
...
@@ -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
[
_
]],
...
...
openmole/core/org.openmole.core.workflow/src/main/scala/org/openmole/core/workflow/sampling/package.scala
View file @
da8dff25
...
...
@@ -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
)
...
...
openmole/plugins/org.openmole.plugin.domain.modifier/src/test/scala/org/openmole/plugin/domain/modifier/ModifierDomainSpec.scala
View file @
da8dff25
...
...
@@ -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
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment