Skip to content

Commit 844ca8b

Browse files
committed
remove underlying modules
1 parent fedc6d4 commit 844ca8b

14 files changed

Lines changed: 239 additions & 287 deletions

src/CWL/CWLTypes.fs

Lines changed: 52 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,57 +2,55 @@ namespace ARCtrl.CWL
22

33
open DynamicObj
44

5-
module CWLTypes =
6-
7-
type FileInstance () =
8-
inherit DynamicObj ()
9-
10-
type DirectoryInstance () =
11-
inherit DynamicObj ()
12-
13-
type DirentInstance = {
14-
// can be string or expression, but expression is string as well
15-
Entry: string
16-
Entryname: string option
17-
Writable: bool option
18-
}
19-
20-
/// Primitive types with the concept of a file and directory as a builtin type.
21-
type CWLType =
22-
/// Represents a file (or group of files when secondaryFiles is provided)
23-
| File of FileInstance
24-
/// Represents a directory to present to a command line tool.
25-
/// Directories are represented as objects with class of Directory. Directory objects have a number of properties that provide metadata about the directory.
26-
| Directory of DirectoryInstance
27-
/// Define a file or subdirectory that must be placed in the designated output directory prior to executing the command line tool.
28-
/// May be the result of executing an expression, such as building a configuration file from a template.
29-
| Dirent of DirentInstance
30-
| String
31-
| Int
32-
| Long
33-
| Float
34-
| Double
35-
| Boolean
36-
| Stdout
37-
| Null
38-
| Array of CWLType
39-
40-
type InputRecordSchema () =
41-
inherit DynamicObj ()
42-
43-
type InputEnumSchema () =
44-
inherit DynamicObj ()
45-
46-
type InputArraySchema () =
47-
inherit DynamicObj ()
48-
49-
type SchemaDefRequirementType (types, definitions) as this =
50-
inherit DynamicObj ()
51-
do
52-
DynObj.setProperty (nameof types) definitions this
53-
54-
type SoftwarePackage = {
55-
Package: string
56-
Version: ResizeArray<string> option
57-
Specs: ResizeArray<string> option
58-
}
5+
type FileInstance () =
6+
inherit DynamicObj ()
7+
8+
type DirectoryInstance () =
9+
inherit DynamicObj ()
10+
11+
type DirentInstance = {
12+
// can be string or expression, but expression is string as well
13+
Entry: string
14+
Entryname: string option
15+
Writable: bool option
16+
}
17+
18+
/// Primitive types with the concept of a file and directory as a builtin type.
19+
type CWLType =
20+
/// Represents a file (or group of files when secondaryFiles is provided)
21+
| File of FileInstance
22+
/// Represents a directory to present to a command line tool.
23+
/// Directories are represented as objects with class of Directory. Directory objects have a number of properties that provide metadata about the directory.
24+
| Directory of DirectoryInstance
25+
/// Define a file or subdirectory that must be placed in the designated output directory prior to executing the command line tool.
26+
/// May be the result of executing an expression, such as building a configuration file from a template.
27+
| Dirent of DirentInstance
28+
| String
29+
| Int
30+
| Long
31+
| Float
32+
| Double
33+
| Boolean
34+
| Stdout
35+
| Null
36+
| Array of CWLType
37+
38+
type InputRecordSchema () =
39+
inherit DynamicObj ()
40+
41+
type InputEnumSchema () =
42+
inherit DynamicObj ()
43+
44+
type InputArraySchema () =
45+
inherit DynamicObj ()
46+
47+
type SchemaDefRequirementType (types, definitions) as this =
48+
inherit DynamicObj ()
49+
do
50+
DynObj.setProperty (nameof types) definitions this
51+
52+
type SoftwarePackage = {
53+
Package: string
54+
Version: ResizeArray<string> option
55+
Specs: ResizeArray<string> option
56+
}

src/CWL/Decode.fs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
namespace ARCtrl.CWL
22

3-
open ARCtrl
43
open YAMLicious
54
open YAMLicious.YAMLiciousTypes
6-
open CWLTypes
7-
open Requirements
8-
open Inputs
9-
open Outputs
10-
open WorkflowSteps
115
open DynamicObj
126

137
module ResizeArray =
@@ -141,7 +135,7 @@ module Decode =
141135
)
142136

143137
/// Decode a YAMLElement into an Output Array
144-
let outputArrayDecoder: (YAMLiciousTypes.YAMLElement -> ResizeArray<Output>) =
138+
let outputArrayDecoder: (YAMLiciousTypes.YAMLElement -> ResizeArray<CWLOutput>) =
145139
Decode.object (fun get ->
146140
let dict = get.Overflow.FieldList []
147141
[|
@@ -154,7 +148,7 @@ module Decode =
154148
| YAMLElement.Object [YAMLElement.Value v] -> cwlTypeStringMatcher v.Value get |> fst
155149
| _ -> cwlTypeDecoder value |> fst
156150
let output =
157-
Output(
151+
CWLOutput(
158152
key,
159153
cwlType
160154
)
@@ -168,7 +162,7 @@ module Decode =
168162
)
169163

170164
/// Access the outputs field and decode a YAMLElement into an Output Array
171-
let outputsDecoder: (YAMLiciousTypes.YAMLElement -> ResizeArray<Output>) =
165+
let outputsDecoder: (YAMLiciousTypes.YAMLElement -> ResizeArray<CWLOutput>) =
172166
Decode.object (fun get ->
173167
let outputs = get.Required.Field "outputs" outputArrayDecoder
174168
outputs
@@ -321,7 +315,7 @@ module Decode =
321315
)
322316

323317
/// Decode a YAMLElement into an Input array
324-
let inputArrayDecoder: (YAMLiciousTypes.YAMLElement -> ResizeArray<Input>) =
318+
let inputArrayDecoder: (YAMLiciousTypes.YAMLElement -> ResizeArray<CWLInput>) =
325319
Decode.object (fun get ->
326320
let dict = get.Overflow.FieldList []
327321
[|
@@ -333,7 +327,7 @@ module Decode =
333327
| YAMLElement.Object [YAMLElement.Value v] -> cwlTypeStringMatcher v.Value get
334328
| _ -> cwlTypeDecoder value
335329
let input =
336-
Input(
330+
CWLInput(
337331
key,
338332
cwlType
339333
)
@@ -347,7 +341,7 @@ module Decode =
347341
)
348342

349343
/// Access the inputs field and decode the YAMLElements into an Input array
350-
let inputsDecoder: (YAMLiciousTypes.YAMLElement -> ResizeArray<Input> option) =
344+
let inputsDecoder: (YAMLiciousTypes.YAMLElement -> ResizeArray<CWLInput> option) =
351345
Decode.object (fun get ->
352346
let outputs = get.Optional.Field "inputs" inputArrayDecoder
353347
outputs

src/CWL/Inputs.fs

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
11
namespace ARCtrl.CWL
22

3-
open CWLTypes
43
open DynamicObj
54
open Fable.Core
65

7-
module Inputs =
6+
type InputBinding = {
7+
Prefix: string option
8+
Position: int option
9+
ItemSeparator: string option
10+
Separate: bool option
11+
}
812

9-
type InputBinding = {
10-
Prefix: string option
11-
Position: int option
12-
ItemSeparator: string option
13-
Separate: bool option
14-
}
15-
16-
[<AttachMembers>]
17-
type Input (
18-
name: string,
19-
?type_: CWLType,
20-
?inputBinding: InputBinding,
21-
?optional: bool
22-
) as this =
23-
inherit DynamicObj ()
24-
do
25-
DynObj.setOptionalProperty ("type") type_ this
26-
DynObj.setOptionalProperty ("inputBinding") inputBinding this
27-
DynObj.setOptionalProperty ("optional") optional this
28-
member this.Name = name
29-
member this.Type_ = DynObj.tryGetTypedPropertyValue<CWLType> ("type") this
30-
member this.InputBinding = DynObj.tryGetTypedPropertyValue<InputBinding> ("inputBinding") this
31-
member this.Optional = DynObj.tryGetTypedPropertyValue<bool> ("optional") this
13+
[<AttachMembers>]
14+
type CWLInput (
15+
name: string,
16+
?type_: CWLType,
17+
?inputBinding: InputBinding,
18+
?optional: bool
19+
) as this =
20+
inherit DynamicObj ()
21+
do
22+
DynObj.setOptionalProperty ("type") type_ this
23+
DynObj.setOptionalProperty ("inputBinding") inputBinding this
24+
DynObj.setOptionalProperty ("optional") optional this
25+
member this.Name = name
26+
member this.Type_ = DynObj.tryGetTypedPropertyValue<CWLType> ("type") this
27+
member this.InputBinding = DynObj.tryGetTypedPropertyValue<InputBinding> ("inputBinding") this
28+
member this.Optional = DynObj.tryGetTypedPropertyValue<bool> ("optional") this

src/CWL/Outputs.fs

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
11
namespace ARCtrl.CWL
22

3-
open CWLTypes
43
open DynamicObj
54
open Fable.Core
65

7-
module Outputs =
6+
type OutputBinding = {
7+
Glob: string option
8+
}
89

9-
type OutputBinding = {
10-
Glob: string option
11-
}
12-
13-
[<AttachMembers>]
14-
type Output (
15-
name: string,
16-
?type_: CWLType,
17-
?outputBinding: OutputBinding,
18-
?outputSource: string
19-
) as this =
20-
inherit DynamicObj ()
21-
do
22-
DynObj.setOptionalProperty ("type") type_ this
23-
DynObj.setOptionalProperty ("outputBinding") outputBinding this
24-
DynObj.setOptionalProperty ("outputSource") outputSource this
25-
member this.Name = name
26-
member this.Type_ = DynObj.tryGetTypedPropertyValue<CWLType> ("type") this
27-
member this.OutputBinding = DynObj.tryGetTypedPropertyValue<OutputBinding> ("outputBinding") this
28-
member this.OutputSource = DynObj.tryGetTypedPropertyValue<string> ("outputSource") this
10+
[<AttachMembers>]
11+
type CWLOutput (
12+
name: string,
13+
?type_: CWLType,
14+
?outputBinding: OutputBinding,
15+
?outputSource: string
16+
) as this =
17+
inherit DynamicObj ()
18+
do
19+
DynObj.setOptionalProperty ("type") type_ this
20+
DynObj.setOptionalProperty ("outputBinding") outputBinding this
21+
DynObj.setOptionalProperty ("outputSource") outputSource this
22+
member this.Name = name
23+
member this.Type_ = DynObj.tryGetTypedPropertyValue<CWLType> ("type") this
24+
member this.OutputBinding = DynObj.tryGetTypedPropertyValue<OutputBinding> ("outputBinding") this
25+
member this.OutputSource = DynObj.tryGetTypedPropertyValue<string> ("outputSource") this

0 commit comments

Comments
 (0)