Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
openmole
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
RoiArthurB
openmole
Commits
5e1d5422
Commit
5e1d5422
authored
Mar 18, 2020
by
Romain Reuillon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Plugin] enh: generify file format for direct sampling
parent
5e628859
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
13 deletions
+12
-13
openmole/core/org.openmole.core.workflow/src/main/scala/org/openmole/core/workflow/mole/package.scala
.../main/scala/org/openmole/core/workflow/mole/package.scala
+1
-0
openmole/plugins/org.openmole.plugin.method.directsampling/src/main/scala/org/openmole/plugin/method/directsampling/package.scala
...a/org/openmole/plugin/method/directsampling/package.scala
+11
-13
No files found.
openmole/core/org.openmole.core.workflow/src/main/scala/org/openmole/core/workflow/mole/package.scala
View file @
5e1d5422
...
...
@@ -24,6 +24,7 @@ package mole {
def
CSVHook
=
mole
.
CSVHook
def
CSVFormat
=
mole
.
CSVHook
.
CSVFormat
type
FileFormat
[
T
]
=
mole
.
FileFormat
[
T
]
type
FromContextHook
=
mole
.
FromContextHook
type
FromContextSource
=
mole
.
FromContextSource
}
...
...
openmole/plugins/org.openmole.plugin.method.directsampling/src/main/scala/org/openmole/plugin/method/directsampling/package.scala
View file @
5e1d5422
...
...
@@ -20,7 +20,7 @@ package org.openmole.plugin.method
import
org.openmole.core.dsl._
import
org.openmole.core.dsl.extension._
import
org.openmole.core.workflow.mole
import
org.openmole.core.workflow.mole.
CSV
Hook
import
org.openmole.core.workflow.mole.
FormattedFile
Hook
import
org.openmole.core.workflow.tools.WritableOutput
import
org.openmole.plugin.domain.distribution._
import
org.openmole.plugin.domain.modifier._
...
...
@@ -35,26 +35,24 @@ package object directsampling {
type
Aggregation
=
AggregateTask
.
AggregateVal
[
_
,
_
]
implicit
class
DirectSamplingDSL
(
dsl
:
DSLContainer
[
DirectSampling
])
extends
DSLContainerHook
(
dsl
)
{
def
hook
(
output
:
WritableOutput
,
values
:
Seq
[
Val
[
_
]]
=
Vector
.
empty
,
header
:
OptionalArgument
[
FromContext
[
String
]]
=
None
,
arrayOnRow
:
Boolean
=
false
)
:
DSLContainer
[
DirectSampling
]
=
{
def
hook
[
T:
FileFormat
](
output
:
WritableOutput
,
values
:
Seq
[
Val
[
_
]]
=
Vector
.
empty
,
format
:
T
=
CSVFormat
())
:
DSLContainer
[
DirectSampling
]
=
{
implicit
val
defScope
=
dsl
.
scope
dsl
hook
CSVHook
(
output
,
values
=
values
,
header
=
header
,
arrayOnRow
=
arrayOnRow
)
dsl
hook
FormattedFileHook
(
output
=
output
,
values
=
values
,
format
=
format
)
}
}
implicit
class
ReplicationDSL
(
dsl
:
DSLContainer
[
Replication
])
extends
DSLContainerHook
(
dsl
)
{
def
hook
(
def
hook
[
T:
FileFormat
]
(
output
:
WritableOutput
,
values
:
Seq
[
Val
[
_
]]
=
Vector
.
empty
,
header
:
OptionalArgument
[
FromContext
[
String
]]
=
None
,
arrayOnRow
:
Boolean
=
false
,
includeSeed
:
Boolean
=
false
)
:
DSLContainer
[
Replication
]
=
{
values
:
Seq
[
Val
[
_
]]
=
Vector
.
empty
,
includeSeed
:
Boolean
=
false
,
format
:
T
=
CSVFormat
())
:
DSLContainer
[
Replication
]
=
{
implicit
val
defScope
=
dsl
.
scope
val
exclude
=
if
(!
includeSeed
)
Seq
(
dsl
.
data
.
seed
)
else
Seq
()
dsl
hook
mole
.
CSVHook
(
output
,
values
=
values
,
exclude
=
exclude
,
header
=
header
,
arrayOnRow
=
arrayOnRow
)
dsl
hook
FormattedFileHook
(
output
=
output
,
values
=
values
,
exclude
=
exclude
,
format
=
format
)
}
}
...
...
Write
Preview
Markdown
is supported
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