Skip to content

Commit

Permalink
Merge pull request #421 from nfdi4plants/CWL
Browse files Browse the repository at this point in the history
CWL Model, Encoding & Decoding
  • Loading branch information
HLWeil authored Oct 21, 2024
2 parents 35ee4ae + 844ca8b commit edb22da
Show file tree
Hide file tree
Showing 35 changed files with 2,007 additions and 9 deletions.
7 changes: 7 additions & 0 deletions ARCtrl.sln
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ARCtrl.Yaml.Tests", "tests\
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ARCtrl.Contract.Tests", "tests\Contract\ARCtrl.Contract.Tests.fsproj", "{D10D12C7-B877-423B-867D-161D99E673C9}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ARCtrl.CWL.Tests", "tests\CWL\ARCtrl.CWL.Tests.fsproj", "{0F2188D3-144C-41BF-89F6-AA85883AE0D3}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ARCtrl.ROCrate", "src\ROCrate\ARCtrl.ROCrate.fsproj", "{658BF141-B4B5-4B90-891D-AC36A3FD7574}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ARCtrl.ROCrate.Tests", "tests\ROCrate\ARCtrl.ROCrate.Tests.fsproj", "{212A1C64-02FC-465A-B0FA-F69735F37ACC}"
Expand Down Expand Up @@ -180,6 +182,10 @@ Global
{D10D12C7-B877-423B-867D-161D99E673C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D10D12C7-B877-423B-867D-161D99E673C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D10D12C7-B877-423B-867D-161D99E673C9}.Release|Any CPU.Build.0 = Release|Any CPU
{0F2188D3-144C-41BF-89F6-AA85883AE0D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0F2188D3-144C-41BF-89F6-AA85883AE0D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0F2188D3-144C-41BF-89F6-AA85883AE0D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0F2188D3-144C-41BF-89F6-AA85883AE0D3}.Release|Any CPU.Build.0 = Release|Any CPU
{658BF141-B4B5-4B90-891D-AC36A3FD7574}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{658BF141-B4B5-4B90-891D-AC36A3FD7574}.Debug|Any CPU.Build.0 = Debug|Any CPU
{658BF141-B4B5-4B90-891D-AC36A3FD7574}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -218,6 +224,7 @@ Global
{1CA11165-4B70-41D2-A846-50374E85385E} = {64B34A6E-318D-4E6E-9262-CE52C9B85A38}
{5810EF87-4F85-4B4C-98E3-833AE914C628} = {64B34A6E-318D-4E6E-9262-CE52C9B85A38}
{D10D12C7-B877-423B-867D-161D99E673C9} = {64B34A6E-318D-4E6E-9262-CE52C9B85A38}
{0F2188D3-144C-41BF-89F6-AA85883AE0D3} = {64B34A6E-318D-4E6E-9262-CE52C9B85A38}
{658BF141-B4B5-4B90-891D-AC36A3FD7574} = {6DA2330B-D407-4FB1-AF05-B0184034EC44}
{212A1C64-02FC-465A-B0FA-F69735F37ACC} = {64B34A6E-318D-4E6E-9262-CE52C9B85A38}
{243ACD5F-10AD-4BE6-9932-829667BE2053} = {64B34A6E-318D-4E6E-9262-CE52C9B85A38}
Expand Down
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageVersion Include="Thoth.Json.Python" Version="0.4.0" />
<PackageVersion Include="Thoth.Json.Newtonsoft" Version="0.2.0" />
<PackageVersion Include="FsSpreadsheet" Version="6.3.0-alpha.4" />
<PackageVersion Include="YAMLicious" Version="0.0.1" />
<PackageVersion Include="YAMLicious" Version="0.0.3" />
<PackageVersion Include="DynamicObj" Version="4.0.3" />
<PackageVersion Include="Fable.SimpleHttp" Version="3.5.0" />
<PackageVersion Include="Fable.Fetch" Version="2.6.0" />
Expand Down
4 changes: 2 additions & 2 deletions src/ARCtrl/ARC.fs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module ARCAux =
|> FileSystem.create
fs.Union(tree)

let updateFSByCWL (cwl : CWL.CWL option) (fs : FileSystem) =
let updateFSByCWL (cwl : unit option) (fs : FileSystem) =
let workflows = FileSystemTree.createWorkflowsFolder [||]
let runs = FileSystemTree.createRunsFolder [||]
let tree =
Expand All @@ -65,7 +65,7 @@ module ARCAux =


[<AttachMembers>]
type ARC(?isa : ArcInvestigation, ?cwl : CWL.CWL, ?fs : FileSystem.FileSystem) =
type ARC(?isa : ArcInvestigation, ?cwl : unit, ?fs : FileSystem.FileSystem) =

let mutable _isa = isa
let mutable _cwl = cwl
Expand Down
14 changes: 13 additions & 1 deletion src/CWL/ARCtrl.CWL.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@
<Import Project="../Package.Metadata.props" />

<ItemGroup>
<Compile Include="Library.fs" />
<Compile Include="CWLTypes.fs" />
<Compile Include="Requirements.fs" />
<Compile Include="Outputs.fs" />
<Compile Include="Inputs.fs" />
<Compile Include="WorkflowSteps.fs" />
<Compile Include="ToolDescription.fs" />
<Compile Include="WorkflowDescription.fs" />
<Compile Include="Decode.fs" />
<Compile Include="Encode.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="YAMLicious" />
<PackageReference Include="DynamicObj" />
</ItemGroup>
</Project>
56 changes: 56 additions & 0 deletions src/CWL/CWLTypes.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
namespace ARCtrl.CWL

open DynamicObj

type FileInstance () =
inherit DynamicObj ()

type DirectoryInstance () =
inherit DynamicObj ()

type DirentInstance = {
// can be string or expression, but expression is string as well
Entry: string
Entryname: string option
Writable: bool option
}

/// Primitive types with the concept of a file and directory as a builtin type.
type CWLType =
/// Represents a file (or group of files when secondaryFiles is provided)
| File of FileInstance
/// Represents a directory to present to a command line tool.
/// Directories are represented as objects with class of Directory. Directory objects have a number of properties that provide metadata about the directory.
| Directory of DirectoryInstance
/// Define a file or subdirectory that must be placed in the designated output directory prior to executing the command line tool.
/// May be the result of executing an expression, such as building a configuration file from a template.
| Dirent of DirentInstance
| String
| Int
| Long
| Float
| Double
| Boolean
| Stdout
| Null
| Array of CWLType

type InputRecordSchema () =
inherit DynamicObj ()

type InputEnumSchema () =
inherit DynamicObj ()

type InputArraySchema () =
inherit DynamicObj ()

type SchemaDefRequirementType (types, definitions) as this =
inherit DynamicObj ()
do
DynObj.setProperty (nameof types) definitions this

type SoftwarePackage = {
Package: string
Version: ResizeArray<string> option
Specs: ResizeArray<string> option
}
Loading

0 comments on commit edb22da

Please sign in to comment.