From d121e5ccddf2715958069283e272369fc731b6a2 Mon Sep 17 00:00:00 2001 From: Heinrich Lukas Weil Date: Mon, 22 Jan 2024 16:09:06 +0100 Subject: [PATCH] remove playground and move speedtest folders --- ARCtrl.sln | 18 ++---- playground/KevinF.fsx | 42 ------------- playground/UNITTEST_Template.json | 1 - playground/testScript.fsx | 62 ------------------- {Speedtest => tests/Speedtest}/LargeStudy.fs | 0 {Speedtest => tests/Speedtest}/Program.fs | 0 .../Speedtest}/Speedtest.fsproj | 2 +- 7 files changed, 7 insertions(+), 118 deletions(-) delete mode 100644 playground/KevinF.fsx delete mode 100644 playground/UNITTEST_Template.json delete mode 100644 playground/testScript.fsx rename {Speedtest => tests/Speedtest}/LargeStudy.fs (100%) rename {Speedtest => tests/Speedtest}/Program.fs (100%) rename {Speedtest => tests/Speedtest}/Speedtest.fsproj (76%) diff --git a/ARCtrl.sln b/ARCtrl.sln index 89a6900b..804fe8ec 100644 --- a/ARCtrl.sln +++ b/ARCtrl.sln @@ -46,12 +46,6 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ARCtrl.ISA.Spreadsheet", "s EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ISA.Spreadsheet.Tests", "tests\ISA\ISA.Spreadsheet.Tests\ISA.Spreadsheet.Tests.fsproj", "{656E8DAF-EFCF-472E-91D0-987D09B74523}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "playground", "playground", "{45E972BE-0BFA-4DE3-B84A-D9F13C4E9D08}" - ProjectSection(SolutionItems) = preProject - playground\KevinF.fsx = playground\KevinF.fsx - playground\testScript.fsx = playground\testScript.fsx - EndProjectSection -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "JavaScript", "JavaScript", "{913222CA-261F-49CB-A823-CC7C335F964A}" ProjectSection(SolutionItems) = preProject tests\JavaScript\ARCtrl.Index.js = tests\JavaScript\ARCtrl.Index.js @@ -72,7 +66,7 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FileSystem.Tests", "tests\F EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "TestingUtils", "tests\TestingUtils\TestingUtils.fsproj", "{AA011593-6603-4E16-A7B0-0ED3862511DE}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Speedtest", "Speedtest\Speedtest.fsproj", "{FA478808-2A4F-486C-8DB1-71208179FF2E}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Speedtest", "tests\Speedtest\Speedtest.fsproj", "{6EFC7E7D-840E-4506-ADBC-37130A21D1C0}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -136,10 +130,10 @@ Global {AA011593-6603-4E16-A7B0-0ED3862511DE}.Debug|Any CPU.Build.0 = Debug|Any CPU {AA011593-6603-4E16-A7B0-0ED3862511DE}.Release|Any CPU.ActiveCfg = Release|Any CPU {AA011593-6603-4E16-A7B0-0ED3862511DE}.Release|Any CPU.Build.0 = Release|Any CPU - {FA478808-2A4F-486C-8DB1-71208179FF2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FA478808-2A4F-486C-8DB1-71208179FF2E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FA478808-2A4F-486C-8DB1-71208179FF2E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FA478808-2A4F-486C-8DB1-71208179FF2E}.Release|Any CPU.Build.0 = Release|Any CPU + {6EFC7E7D-840E-4506-ADBC-37130A21D1C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6EFC7E7D-840E-4506-ADBC-37130A21D1C0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6EFC7E7D-840E-4506-ADBC-37130A21D1C0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6EFC7E7D-840E-4506-ADBC-37130A21D1C0}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -161,7 +155,7 @@ Global {1945EE8A-F105-43A9-91C9-8C4422B9873E} = {6DA2330B-D407-4FB1-AF05-B0184034EC44} {D9FE196B-AC21-4C3E-B9AE-DDDEC2158BC3} = {64B34A6E-318D-4E6E-9262-CE52C9B85A38} {AA011593-6603-4E16-A7B0-0ED3862511DE} = {64B34A6E-318D-4E6E-9262-CE52C9B85A38} - {FA478808-2A4F-486C-8DB1-71208179FF2E} = {64B34A6E-318D-4E6E-9262-CE52C9B85A38} + {6EFC7E7D-840E-4506-ADBC-37130A21D1C0} = {64B34A6E-318D-4E6E-9262-CE52C9B85A38} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {1E354DE6-99BA-421E-9EF8-E808B855A85F} diff --git a/playground/KevinF.fsx b/playground/KevinF.fsx deleted file mode 100644 index 2f96c9e0..00000000 --- a/playground/KevinF.fsx +++ /dev/null @@ -1,42 +0,0 @@ -#r "nuget: Fable.Core, 4.0.0" -#r "nuget: FsSpreadsheet, 2.0.2" -#r "nuget: FsSpreadsheet.ExcelIO, 2.0.2" -#r "nuget: Thoth.Json.Net, 11.0.0" -#r "nuget: Fable.SimpleHttp, 3.5.0" -#r "nuget: Fable.Promise, 3.2.0" -#r "nuget: Fable.Fetch, 2.6.0" -#I @"../src\ARCtrl/bin\Debug\netstandard2.0" -#r "ARCtrl.ISA.dll" -#r "ARCtrl.Contract.dll" -#r "ARCtrl.FileSystem.dll" -#r "ARCtrl.ISA.Spreadsheet.dll" -#r "ARCtrl.CWL.dll" -#r "ARCtrl.dll" - -open Thoth.Json.Net - -open ARCtrl -open ARCtrl.ISA -open ARCtrl.Templates -open ARCtrl.Templates.Json - -let path = @"C:\Users\Kevin\source\repos\ARCtrl\playground" - -let baseUrl = @"https://github.com/nfdi4plants/Swate-templates/releases/download/latest/templates.json" - -let decoder : Thoth.Json.Net.Decoder> = Thoth.Json.Net.Decode.dict Json.Template.decode - -let dict (json: string) = - json - |> Thoth.Json.Net.Decode.fromString decoder - -let GetTemplates() = - ARCtrl.WebRequest.downloadFile baseUrl (fun json -> - let mapResult = dict json - match mapResult with - | Ok map -> printfn "%A" map.Count - | Error exn -> failwith "Unable to parse json to template []" - ) - |> Async.RunSynchronously - -GetTemplates() \ No newline at end of file diff --git a/playground/UNITTEST_Template.json b/playground/UNITTEST_Template.json deleted file mode 100644 index 4d16e9e7..00000000 --- a/playground/UNITTEST_Template.json +++ /dev/null @@ -1 +0,0 @@ -{"id":"e83957e9-8865-498f-8c3e-629da103037c","table":[{"name":"My Table","inputs":[{"name":"Source 0","characteristics":[]},{"name":"Source 1","characteristics":[]},{"name":"Source 2","characteristics":[]},{"name":"Source 3","characteristics":[]},{"name":"Source 4","characteristics":[]},{"name":"Source 5","characteristics":[]},{"name":"Source 6","characteristics":[]},{"name":"Source 7","characteristics":[]},{"name":"Source 8","characteristics":[]},{"name":"Source 9","characteristics":[]}],"outputs":[{"name":"Output 0","type":"Raw Data File"},{"name":"Output 1","type":"Raw Data File"},{"name":"Output 2","type":"Raw Data File"},{"name":"Output 3","type":"Raw Data File"},{"name":"Output 4","type":"Raw Data File"},{"name":"Output 5","type":"Raw Data File"},{"name":"Output 6","type":"Raw Data File"},{"name":"Output 7","type":"Raw Data File"},{"name":"Output 8","type":"Raw Data File"},{"name":"Output 9","type":"Raw Data File"}]}],"name":"MyTemplate","description":"","organisation":"Custom Organisation","version":"0.0.0","authors":[{"firstName":"John","lastName":"Doe"},{"firstName":"Jane","lastName":"Doe"}],"endpoint_repositories":[{"annotationValue":"Test"},{"annotationValue":"Testing second"}],"tags":[],"last_updated":"2023-09-21T12:45:46.9449945Z"} \ No newline at end of file diff --git a/playground/testScript.fsx b/playground/testScript.fsx deleted file mode 100644 index f2e0fea6..00000000 --- a/playground/testScript.fsx +++ /dev/null @@ -1,62 +0,0 @@ -#r "nuget: FsSpreadsheet, 2.0.1" -#r "nuget: FsSpreadsheet.ExcelIO, 1.2.0-preview" -#r "nuget: Fable.Core, 4.0.0" -#r "nuget: ISADotNet.XLSX" - -#I @"C:\Users\HLWei\source\repos\ARC_tools\arcAPI\src\ARC\bin\Debug\netstandard2.0" -#r "ARC.dll" -#r "CWL.dll" -#r "FileSystem.dll" -#r "ISA.dll" - -open ARC -open ARCtrl.FileSystem -open ARCtrl.ISA -open System.IO - -let arcPath = Path.Combine(__SOURCE_DIRECTORY__, "testArc") - -// Function to recursively read file system and return a FileSystemTree -let rec readFileSystem (path : string) : FileSystemTree = - let folderName = DirectoryInfo(path).Name - let fileName file = FileInfo(file).Name - let files = Directory.GetFiles(path) - let folders = Directory.GetDirectories(path) - let children = - folders - |> Array.map (fun folder -> readFileSystem folder) - |> Array.append (files |> Array.map (fun file -> fileName file |> FileSystemTree.createFile)) - FileSystemTree.createFolder(folderName, children) - -open FsSpreadsheet.ExcelIO -open FsSpreadsheet - -let readArc (path : string) : ARC = - let fs = readFileSystem arcPath - //let arc = ARC.create(Investigation.create(), (), FileSystem.create(fs,[||])) - - let isaItems = - ARC.getContractsForFileTree fs - //ARC.getISAContracts arc - |> Array.map (fun isaContract -> - let workbook = - FsWorkbook.fromXlsxFile isaContract.Path - {isaContract with - Data = Some(Spreadsheet(workbook)) - } - ) - - let arcWithIsa = ARC.fillContracts isaItems fs - - - //let assay = Assay.create() - //let arcWithAssay = ARC.addAssay assay "test" arcWithIsa - - //let outContracts = ARC.getContracts arcWithAssay - - //outContracts - //|> Array.map (fun c -> - // () - //) |> ignore - - raise (System.NotImplementedException()) diff --git a/Speedtest/LargeStudy.fs b/tests/Speedtest/LargeStudy.fs similarity index 100% rename from Speedtest/LargeStudy.fs rename to tests/Speedtest/LargeStudy.fs diff --git a/Speedtest/Program.fs b/tests/Speedtest/Program.fs similarity index 100% rename from Speedtest/Program.fs rename to tests/Speedtest/Program.fs diff --git a/Speedtest/Speedtest.fsproj b/tests/Speedtest/Speedtest.fsproj similarity index 76% rename from Speedtest/Speedtest.fsproj rename to tests/Speedtest/Speedtest.fsproj index ac43e07a..dcf57223 100644 --- a/Speedtest/Speedtest.fsproj +++ b/tests/Speedtest/Speedtest.fsproj @@ -11,7 +11,7 @@ - +