Skip to content

Commit

Permalink
Fix compatibility with Julia 1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
lbonaldo committed Nov 13, 2023
1 parent c3c0671 commit ff2a8fe
Show file tree
Hide file tree
Showing 8 changed files with 5,612 additions and 4 deletions.
File renamed without changes.
1,849 changes: 1,849 additions & 0 deletions test/TDR/TDR_Results_true_LTS/Demand_data.csv

Large diffs are not rendered by default.

1,850 changes: 1,850 additions & 0 deletions test/TDR/TDR_Results_true_LTS/Fuels_data.csv

Large diffs are not rendered by default.

1,849 changes: 1,849 additions & 0 deletions test/TDR/TDR_Results_true_LTS/Generators_variability.csv

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions test/TDR/TDR_Results_true_LTS/Period_map.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Period_Index,Rep_Period,Rep_Period_Index
1,8,1
2,8,1
3,8,1
4,8,1
5,8,1
6,8,1
7,8,1
8,8,1
9,8,1
10,8,1
11,8,1
12,8,1
13,8,1
14,15,2
15,15,2
16,15,2
17,15,2
18,18,3
19,15,2
20,21,4
21,21,4
22,21,4
23,18,3
24,21,4
25,25,5
26,26,6
27,26,6
28,33,9
29,29,7
30,33,9
31,31,8
32,33,9
33,33,9
34,33,9
35,33,9
36,21,4
37,21,4
38,18,3
39,18,3
40,21,4
41,21,4
42,15,2
43,18,3
44,15,2
45,21,4
46,18,3
47,21,4
48,48,10
49,8,1
50,8,1
51,51,11
52,8,1
Binary file added test/TDR/TDR_Results_true_LTS/clusters_true.jld2
Binary file not shown.
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ end
end

@testset "Method of Morris" begin
include("test_methodofmorris.jl")
VERSION v"1.7" && include("test_methodofmorris.jl")
end

@testset "Multi Stage" begin
Expand Down
13 changes: 10 additions & 3 deletions test/test_time_domain_reduction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,15 @@ redirect_stdout(devnull)

test_folder = settings_path = "TDR"
TDR_Results_test = joinpath(test_folder, "TDR_Results_test")
TDR_Results_true = joinpath(test_folder, "TDR_Results_true")

# Folder with true clustering results for LTS and non-LTS versions
TDR_Results_true = if VERSION == v"1.6.7"
joinpath(test_folder, "TDR_Results_true_LTS")
else
joinpath(test_folder, "TDR_Results_true")
end

# Remove test folder if it exists
if isdir(TDR_Results_test)
rm(TDR_Results_test, recursive = true)
end
Expand All @@ -38,7 +45,7 @@ clustering_test =
GenX.cluster_inputs(test_folder, settings_path, genx_setup, random = false)["ClusterObject"]

# Load true clustering
clustering_true = JLD2.load(joinpath(test_folder, "clusters_true.jld2"))["ClusterObject"]
clustering_true = JLD2.load(joinpath(TDR_Results_true, "clusters_true.jld2"))["ClusterObject"]

# Clustering validation
R = Clustering.randindex(clustering_test, clustering_true)
Expand All @@ -53,7 +60,7 @@ Test.@test round(R[2], digits = 1) == 1 # Rand index should be equal to 1
Test.@test round(I, digits = 1) == 1 # Mutual information should be equal to 1

# test if output files are correct
Test.@testset for file in filter(endswith(".csv"), readdir(TDR_Results_true))
for file in filter(endswith(".csv"), readdir(TDR_Results_true))
Test.@test cmp_csv(joinpath(TDR_Results_test, file), joinpath(TDR_Results_true, file))
end

Expand Down

0 comments on commit ff2a8fe

Please sign in to comment.