Skip to content

Commit

Permalink
fix for new dynamic obj version
Browse files Browse the repository at this point in the history
  • Loading branch information
caroott authored and kMutagene committed Oct 21, 2024
1 parent 7007a0b commit 17fabe8
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/CWL/CWLTypes.fs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module CWLTypes =
type SchemaDefRequirementType (types, definitions) as this =
inherit DynamicObj ()
do
DynObj.setValue this (nameof types) definitions
DynObj.setProperty (nameof types) definitions this

type SoftwarePackage = {
Package: string
Expand Down
11 changes: 6 additions & 5 deletions src/CWL/Decode.fs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ module Decode =
for e in dict do
match e.Value with
| YAMLElement.Object [YAMLElement.Value v] ->
DynObj.setValue dynObj e.Key v.Value
DynObj.setProperty e.Key v.Value dynObj
| YAMLElement.Object [YAMLElement.Sequence s] ->
let newDynObj = new DynamicObj ()
(s |> List.map ((Decode.object (fun get -> (get.Overflow.FieldList []))) >> overflowDecoder newDynObj))
|> List.iter (fun x ->
DynObj.setValue
dynObj
DynObj.setProperty
e.Key
x
dynObj
)
| _ -> DynObj.setProperty e.Key e.Value dynObj
dynObj

let outputBindingGlobDecoder: (YAMLiciousTypes.YAMLElement -> OutputBinding) =
Expand Down Expand Up @@ -118,7 +119,7 @@ module Decode =
cwlType
)
if outputBinding.IsSome then
DynObj.setValueOpt output "outputBinding" outputBinding
DynObj.setOptionalProperty "outputBinding" outputBinding output
output
|]
)
Expand Down Expand Up @@ -291,7 +292,7 @@ module Decode =
cwlType
)
if inputBinding.IsSome then
DynObj.setValueOpt input "inputBinding" inputBinding
DynObj.setOptionalProperty "inputBinding" inputBinding input
input
|]
)
Expand Down
8 changes: 4 additions & 4 deletions src/CWL/Inputs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ module Inputs =
) as this =
inherit DynamicObj ()
do
DynObj.setValueOpt this ("type") type_
DynObj.setValueOpt this ("inputBinding") inputBinding
DynObj.setOptionalProperty ("type") type_ this
DynObj.setOptionalProperty ("inputBinding") inputBinding this
member this.Name = name
member this.Type = DynObj.tryGetTypedValue<CWLType> ("type") this
member this.InputBinding = DynObj.tryGetTypedValue<InputBinding> ("inputBinding") this
member this.Type = DynObj.tryGetTypedPropertyValue<CWLType> ("type") this
member this.InputBinding = DynObj.tryGetTypedPropertyValue<InputBinding> ("inputBinding") this

module Workflow =

Expand Down
8 changes: 4 additions & 4 deletions src/CWL/Outputs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ module Outputs =
) as this =
inherit DynamicObj ()
do
DynObj.setValueOpt this ("type") type_
DynObj.setValueOpt this ("outputBinding") outputBinding
DynObj.setOptionalProperty ("type") type_ this
DynObj.setOptionalProperty ("outputBinding") outputBinding this
member this.Name = name
member this.Type = DynObj.tryGetTypedValue<CWLType> ("type") this
member this.OutputBinding = DynObj.tryGetTypedValue<OutputBinding> ("outputBinding") this
member this.Type = DynObj.tryGetTypedPropertyValue<CWLType> ("type") this
member this.OutputBinding = DynObj.tryGetTypedPropertyValue<OutputBinding> ("outputBinding") this

module Workflow =

Expand Down
16 changes: 8 additions & 8 deletions src/CWL/Requirements.fs
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ module Requirements =
) as this =
inherit DynamicObj ()
do
DynObj.setValueOpt this (nameof coresMin) coresMin
DynObj.setValueOpt this (nameof coresMax) coresMax
DynObj.setValueOpt this (nameof ramMin) ramMin
DynObj.setValueOpt this (nameof ramMax) ramMax
DynObj.setValueOpt this (nameof tmpdirMin) tmpdirMin
DynObj.setValueOpt this (nameof tmpdirMax) tmpdirMax
DynObj.setValueOpt this (nameof outdirMin) outdirMin
DynObj.setValueOpt this (nameof outdirMax) outdirMax
DynObj.setOptionalProperty (nameof coresMin) coresMin this
DynObj.setOptionalProperty (nameof coresMax) coresMax this
DynObj.setOptionalProperty (nameof ramMin) ramMin this
DynObj.setOptionalProperty (nameof ramMax) ramMax this
DynObj.setOptionalProperty (nameof tmpdirMin) tmpdirMin this
DynObj.setOptionalProperty (nameof tmpdirMax) tmpdirMax this
DynObj.setOptionalProperty (nameof outdirMin) outdirMin this
DynObj.setOptionalProperty (nameof outdirMax) outdirMax this

type Requirement =
| InlineJavascriptRequirement
Expand Down

0 comments on commit 17fabe8

Please sign in to comment.