Skip to content

Commit

Permalink
Merge pull request #237 from nfdi4plants/update_arctrl
Browse files Browse the repository at this point in the history
Update to arctrl.net 1.0.2
  • Loading branch information
HLWeil authored Jan 25, 2024
2 parents 8a4bf16 + 3897ff8 commit f416507
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/ArcCommander/APIs/StudyAPI.fs
Original file line number Diff line number Diff line change
Expand Up @@ -736,13 +736,13 @@ module StudyAPI =
|> List.toArray

let existsByName name publications =
OntologyAnnotation.existsByName (AnnotationValue.Text name) (publications |> Array.toList)
OntologyAnnotation.existsByName name (publications |> Array.toList)

let tryGetByName name publications =
OntologyAnnotation.tryGetByName (AnnotationValue.Text name) (publications |> Array.toList)
OntologyAnnotation.tryGetByName name (publications |> Array.toList)

let removeByName name publications =
OntologyAnnotation.removeByName (AnnotationValue.Text name) (publications |> Array.toList)
OntologyAnnotation.removeByName name (publications |> Array.toList)
|> List.toArray

/// Updates an existing design in the ARC investigation study with the given design metadata contained in cliArgs.
Expand Down
7 changes: 4 additions & 3 deletions src/ArcCommander/ArcCommander.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,13 @@

<!--References-->
<ItemGroup>
<PackageReference Update="FSharp.Core" Version="7.0.401" />
<PackageReference Include="ARCtrl.NET" Version="1.0.0-beta.2" />
<PackageReference Include="Argu" Version="6.1.1" />
<PackageReference Update="FSharp.Core" Version="8.0.101" />
<PackageReference Include="ARCtrl.NET" Version="1.0.2" />
<PackageReference Include="Argu" Version="6.1.4" />
<PackageReference Include="Fake.IO.FileSystem" Version="6.0.0" />
<PackageReference Include="Fake.Tools.Git" Version="6.0.0" />
<PackageReference Include="FSharp.Data" Version="5.0.2" />
<PackageReference Include="FsSpreadsheet" Version="5.1.0" />
<PackageReference Include="IdentityModel.OidcClient" Version="5.2.1" />
<PackageReference Include="ini-parser-netstandard" Version="2.5.2" />
<PackageReference Include="Giraffe" Version="6.0.0" />
Expand Down
2 changes: 1 addition & 1 deletion src/ArcCommander/ArcConfiguration.fs
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ module ARCExtensions =
type ARC with

member this.Write(arcPath) =
this.GetWriteContracts()
this.GetWriteContracts(false)
|> Array.iter (myWrite arcPath)

static member load(config : ArcConfiguration) =
Expand Down
3 changes: 1 addition & 2 deletions tests/ArcCommander.Tests/ArcCommander.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
<PackageReference Include="Expecto" Version="10.1.0" />
<PackageReference Include="YoloDev.Expecto.TestSdk" Version="0.*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.*" />
<PackageReference Update="FSharp.Core" Version="7.0.401" />
<PackageReference Include="Argu" Version="6.1.1" />
<PackageReference Update="FSharp.Core" Version="8.0.101" />
<PackageReference Include="ini-parser-netstandard" Version="2.5.2" />
</ItemGroup>
<ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions tests/ArcCommander.Tests/StudyTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,16 @@ let testStudyContacts =
let investigationFilePath = System.IO.Path.Combine([|GeneralConfiguration.getWorkDirectory config;investigationFileName|])
let studyIdentifier = "BII-S-1"

let studyToCopy = System.IO.Path.Combine([|source;"TestFiles";"studies"|])
let studyFilePath = System.IO.Path.Combine([|GeneralConfiguration.getWorkDirectory config;"studies"|])


setupArc config

//Copy testInvestigation
System.IO.File.Copy(investigationToCopy,investigationFilePath,true)
//Copy testStudy
directoryCopy studyToCopy studyFilePath true

let arc = ARC.load(config)

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
20 changes: 20 additions & 0 deletions tests/ArcCommander.Tests/Utils.fs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,26 @@ open ArcCommander
open ArgumentProcessing
open Argu

let rec directoryCopy srcPath dstPath copySubDirs =

if not <| System.IO.Directory.Exists(srcPath) then
let msg = System.String.Format("Source directory does not exist or could not be found: {0}", srcPath)
raise (System.IO.DirectoryNotFoundException(msg))

if not <| System.IO.Directory.Exists(dstPath) then
System.IO.Directory.CreateDirectory(dstPath) |> ignore

let srcDir = new System.IO.DirectoryInfo(srcPath)

for file in srcDir.GetFiles() do
let temppath = System.IO.Path.Combine(dstPath, file.Name)
file.CopyTo(temppath, true) |> ignore

if copySubDirs then
for subdir in srcDir.GetDirectories() do
let dstSubDir = System.IO.Path.Combine(dstPath, subdir.Name)
directoryCopy subdir.FullName dstSubDir copySubDirs

type ArcInvestigation with

member this.ContainsStudy(studyIdentifier : string) =
Expand Down

0 comments on commit f416507

Please sign in to comment.