From 8065850159b211055803ce87334eefd2c6cf5a1d Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sun, 19 Jan 2025 15:43:17 -0700 Subject: [PATCH 01/14] bump psy version --- Project.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 37d86066..3456b5de 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PowerNetworkMatrices" uuid = "bed98974-b02a-5e2f-9fe0-a103f5c450dd" authors = ["Jose Daniel Lara", "Alessandro Francesco Castelli", "Sourabh Dalvi"] -version = "0.11.1" +version = "0.11.2" [deps] DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" @@ -22,6 +22,6 @@ LinearAlgebra = "1" MKL = "0.6" KLU = "^0.6" Pardiso = "^0.5.5" -PowerSystems = "4" +PowerSystems = "^4.5" SparseArrays = "1" julia = "^1.6" From 413d461f7ca67b196fa7d8449c0f97f25b334a05 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sun, 19 Jan 2025 16:06:32 -0700 Subject: [PATCH 02/14] test better use of LinearAlgebra --- src/PowerNetworkMatrices.jl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/PowerNetworkMatrices.jl b/src/PowerNetworkMatrices.jl index 83524523..965b3e91 100644 --- a/src/PowerNetworkMatrices.jl +++ b/src/PowerNetworkMatrices.jl @@ -22,7 +22,6 @@ export VirtualPTDF export Ybus using DocStringExtensions -import MKL import InfrastructureSystems import PowerSystems import PowerSystems: ACBusTypes @@ -30,6 +29,18 @@ import PowerSystems: ACBusTypes const IS = InfrastructureSystems const PSY = PowerSystems +@static if Sys.ARCH === :x86_64 || Sys.ARCH === :i686 + import MKL + const usemkl = MKL.MKL_jll.is_available() + else + const usemkl = false + end + +@static if !Sys.isapple() + import AppleAccelerate +end + + import SparseArrays import SparseArrays: rowvals, nzrange import HDF5 @@ -41,6 +52,7 @@ import LinearAlgebra: ldiv!, mul!, I, dot import LinearAlgebra: LAPACK.getrf!, LAPACK.getrs! import Pardiso + @template DEFAULT = """ $(SIGNATURES) $(DOCSTRING) From 0efc2650b515abed7f2a85523353ff676751c6ff Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sun, 19 Jan 2025 16:07:39 -0700 Subject: [PATCH 03/14] change conditional --- src/PowerNetworkMatrices.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PowerNetworkMatrices.jl b/src/PowerNetworkMatrices.jl index 965b3e91..d58e632f 100644 --- a/src/PowerNetworkMatrices.jl +++ b/src/PowerNetworkMatrices.jl @@ -36,7 +36,7 @@ const PSY = PowerSystems const usemkl = false end -@static if !Sys.isapple() +@static if Sys.isapple() import AppleAccelerate end From dfae61dbcefdd3c48d44d9b15127736dcac3fcae Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sun, 19 Jan 2025 16:10:14 -0700 Subject: [PATCH 04/14] update mkl checks --- src/lodf_calculations.jl | 5 ++++- src/ptdf_calculations.jl | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lodf_calculations.jl b/src/lodf_calculations.jl index 9f817d9b..271c855d 100644 --- a/src/lodf_calculations.jl +++ b/src/lodf_calculations.jl @@ -37,6 +37,9 @@ function _buildlodf( elseif linear_solver == "Dense" lodf_t = _calculate_LODF_matrix_DENSE(a, ptdf) elseif linear_solver == "MKLPardiso" + if !usemkl + error("The MKL library is not available. Check that your hardware and operating system support MKL.") + end lodf_t = _calculate_LODF_matrix_MKLPardiso(a, ptdf) end return lodf_t @@ -52,7 +55,7 @@ function _buildlodf( if linear_solver == "KLU" lodf_t = _calculate_LODF_matrix_KLU(a, k, ba, ref_bus_positions) else - error("Other methods still to be implemented.") + error("Other linear solvers are not implemented.") end return lodf_t end diff --git a/src/ptdf_calculations.jl b/src/ptdf_calculations.jl index d826b4c2..09520dc2 100644 --- a/src/ptdf_calculations.jl +++ b/src/ptdf_calculations.jl @@ -65,6 +65,9 @@ function _buildptdf( dist_slack, ) elseif linear_solver == "MKLPardiso" + if !usemkl + error("The MKL library is not available. Check that your hardware and operating system support MKL.") + end PTDFm, A = calculate_PTDF_matrix_MKLPardiso( branches, buses, From e5a80b03da360331d027f69ab0fa98b22a6cc251 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sun, 19 Jan 2025 16:23:15 -0700 Subject: [PATCH 05/14] try weakdeps --- Project.toml | 12 ++++++++---- src/PowerNetworkMatrices.jl | 16 +++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Project.toml b/Project.toml index 3456b5de..8d5d8703 100644 --- a/Project.toml +++ b/Project.toml @@ -9,18 +9,22 @@ HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" InfrastructureSystems = "2cd47ed4-ca9b-11e9-27f2-ab636a7671f1" KLU = "ef3ab10e-7fda-4108-b977-705223b18434" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" -MKL = "33e6dc65-8f57-5167-99aa-e5a354878fb2" -Pardiso = "46dd5b70-b6fb-5a00-ae2d-e8fea33afaf2" PowerSystems = "bcd98974-b02a-5e2f-9ee0-a103f5c450dd" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" +[weakdeps] +AppleAccelerate = "13e28ba4-7ad8-5781-acae-3021b1ed3924" +MKL = "33e6dc65-8f57-5167-99aa-e5a354878fb2" +Pardiso = "46dd5b70-b6fb-5a00-ae2d-e8fea33afaf2" + [compat] +AppleAccelerate = "^0.4" DocStringExtensions = "~0.8, ~0.9" HDF5 = "0.17" InfrastructureSystems = "2" -LinearAlgebra = "1" -MKL = "0.6" KLU = "^0.6" +LinearAlgebra = "1" +MKL = "0.7" Pardiso = "^0.5.5" PowerSystems = "^4.5" SparseArrays = "1" diff --git a/src/PowerNetworkMatrices.jl b/src/PowerNetworkMatrices.jl index d58e632f..a139f347 100644 --- a/src/PowerNetworkMatrices.jl +++ b/src/PowerNetworkMatrices.jl @@ -29,18 +29,17 @@ import PowerSystems: ACBusTypes const IS = InfrastructureSystems const PSY = PowerSystems -@static if Sys.ARCH === :x86_64 || Sys.ARCH === :i686 - import MKL - const usemkl = MKL.MKL_jll.is_available() - else - const usemkl = false - end +@static if (Sys.ARCH === :x86_64 || Sys.ARCH === :i686) && !Sys.isapple() + using MKL + const usemkl = MKL.MKL_jll.is_available() +else + const usemkl = false +end @static if Sys.isapple() - import AppleAccelerate + using AppleAccelerate end - import SparseArrays import SparseArrays: rowvals, nzrange import HDF5 @@ -52,7 +51,6 @@ import LinearAlgebra: ldiv!, mul!, I, dot import LinearAlgebra: LAPACK.getrf!, LAPACK.getrs! import Pardiso - @template DEFAULT = """ $(SIGNATURES) $(DOCSTRING) From 57d5541fb7509bfeb899f146c802561c6ee11cdd Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sun, 19 Jan 2025 16:28:17 -0700 Subject: [PATCH 06/14] more update for conditional solver user --- src/PowerNetworkMatrices.jl | 5 +++-- src/lodf_calculations.jl | 6 ++++-- src/ptdf_calculations.jl | 6 ++++-- test/test_lodf.jl | 4 +++- test/test_ptdf.jl | 4 ++++ 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/PowerNetworkMatrices.jl b/src/PowerNetworkMatrices.jl index a139f347..c4e205e5 100644 --- a/src/PowerNetworkMatrices.jl +++ b/src/PowerNetworkMatrices.jl @@ -31,13 +31,14 @@ const PSY = PowerSystems @static if (Sys.ARCH === :x86_64 || Sys.ARCH === :i686) && !Sys.isapple() using MKL - const usemkl = MKL.MKL_jll.is_available() + const USE_MKL = MKL.MKL_jll.is_available() else - const usemkl = false + const USE_MKL = false end @static if Sys.isapple() using AppleAccelerate + const USE_AA = false end import SparseArrays diff --git a/src/lodf_calculations.jl b/src/lodf_calculations.jl index 271c855d..ca74aedb 100644 --- a/src/lodf_calculations.jl +++ b/src/lodf_calculations.jl @@ -37,8 +37,10 @@ function _buildlodf( elseif linear_solver == "Dense" lodf_t = _calculate_LODF_matrix_DENSE(a, ptdf) elseif linear_solver == "MKLPardiso" - if !usemkl - error("The MKL library is not available. Check that your hardware and operating system support MKL.") + if !USE_MKL + error( + "The MKL library is not available. Check that your hardware and operating system support MKL.", + ) end lodf_t = _calculate_LODF_matrix_MKLPardiso(a, ptdf) end diff --git a/src/ptdf_calculations.jl b/src/ptdf_calculations.jl index 09520dc2..dc7b74d8 100644 --- a/src/ptdf_calculations.jl +++ b/src/ptdf_calculations.jl @@ -65,8 +65,10 @@ function _buildptdf( dist_slack, ) elseif linear_solver == "MKLPardiso" - if !usemkl - error("The MKL library is not available. Check that your hardware and operating system support MKL.") + if !USE_MKL + error( + "The MKL library is not available. Check that your hardware and operating system support MKL.", + ) end PTDFm, A = calculate_PTDF_matrix_MKLPardiso( branches, diff --git a/test/test_lodf.jl b/test/test_lodf.jl index 3fb8ca9f..2810f120 100644 --- a/test/test_lodf.jl +++ b/test/test_lodf.jl @@ -24,7 +24,9 @@ P5 = PTDF(sys5) L5NS_from_ptdf = LODF(A, P5) L5NS_from_ptdf2 = LODF(A, P5; linear_solver = "Dense") - L5NS_from_ptdf3 = LODF(A, P5; linear_solver = "MKLPardiso") + if !PowerNetworkMatrices.USE_AA + L5NS_from_ptdf3 = LODF(A, P5; linear_solver = "MKLPardiso") + end @test getindex(L5NS_from_ptdf, "5", "6") - -0.3071 <= 1e-4 @test getindex(L5NS_from_ptdf2, "5", "6") - -0.3071 <= 1e-4 @test getindex(L5NS_from_ptdf3, "5", "6") - -0.3071 <= 1e-4 diff --git a/test/test_ptdf.jl b/test/test_ptdf.jl index 6d59fb9c..a04eed57 100644 --- a/test/test_ptdf.jl +++ b/test/test_ptdf.jl @@ -1,6 +1,10 @@ @testset "Test PTDF matrices, w/ and w/o tolerance" begin sys5 = PSB.build_system(PSB.PSITestSystems, "c_sys5") for solver in ["KLU", "Dense", "MKLPardiso"] + if !PowerNetworkMatrices.USE_AA && solver == "MKLPardiso" + @info "Skippe MKLPardiso tests on Apple" + continue + end for approach in ["standard", "separate_matrices"] buses_5 = nodes5() branches_5 = branches5(buses_5) From f19bed1a0d31c82dba939f6cf3fa08b97fbadf0f Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sun, 19 Jan 2025 16:35:51 -0700 Subject: [PATCH 07/14] add exception to Aqua --- Project.toml | 2 -- src/PowerNetworkMatrices.jl | 2 +- test/runtests.jl | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index 8d5d8703..ca508519 100644 --- a/Project.toml +++ b/Project.toml @@ -11,8 +11,6 @@ KLU = "ef3ab10e-7fda-4108-b977-705223b18434" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" PowerSystems = "bcd98974-b02a-5e2f-9ee0-a103f5c450dd" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" - -[weakdeps] AppleAccelerate = "13e28ba4-7ad8-5781-acae-3021b1ed3924" MKL = "33e6dc65-8f57-5167-99aa-e5a354878fb2" Pardiso = "46dd5b70-b6fb-5a00-ae2d-e8fea33afaf2" diff --git a/src/PowerNetworkMatrices.jl b/src/PowerNetworkMatrices.jl index c4e205e5..c4f85dd9 100644 --- a/src/PowerNetworkMatrices.jl +++ b/src/PowerNetworkMatrices.jl @@ -31,6 +31,7 @@ const PSY = PowerSystems @static if (Sys.ARCH === :x86_64 || Sys.ARCH === :i686) && !Sys.isapple() using MKL + using Pardiso const USE_MKL = MKL.MKL_jll.is_available() else const USE_MKL = false @@ -50,7 +51,6 @@ import LinearAlgebra import LinearAlgebra: BLAS.gemm import LinearAlgebra: ldiv!, mul!, I, dot import LinearAlgebra: LAPACK.getrf!, LAPACK.getrs! -import Pardiso @template DEFAULT = """ $(SIGNATURES) diff --git a/test/runtests.jl b/test/runtests.jl index fd3725e9..2b9a8850 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -20,7 +20,7 @@ Aqua.test_unbound_args(PowerNetworkMatrices) Aqua.test_undefined_exports(PowerNetworkMatrices) Aqua.test_ambiguities(PowerNetworkMatrices) Aqua.test_stale_deps(PowerNetworkMatrices) -Aqua.test_deps_compat(PowerNetworkMatrices) +Aqua.test_deps_compat(PowerNetworkMatrices; ignore = [:AppleAccelerate, :MKL, :Pardiso]) include("testing_data.jl") From 73791106c8bb87ff871c98cfd5ba67920bb993f9 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sun, 19 Jan 2025 16:36:52 -0700 Subject: [PATCH 08/14] fix Aqua test change --- test/runtests.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 2b9a8850..a686c076 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -19,8 +19,8 @@ import Aqua Aqua.test_unbound_args(PowerNetworkMatrices) Aqua.test_undefined_exports(PowerNetworkMatrices) Aqua.test_ambiguities(PowerNetworkMatrices) -Aqua.test_stale_deps(PowerNetworkMatrices) -Aqua.test_deps_compat(PowerNetworkMatrices; ignore = [:AppleAccelerate, :MKL, :Pardiso]) +Aqua.test_stale_deps(PowerNetworkMatrices; ignore = [:AppleAccelerate, :MKL, :Pardiso]) +Aqua.test_deps_compat(PowerNetworkMatrices) include("testing_data.jl") From 65d38aa44d9f3a3b60380636ccba990f4c0dea74 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sun, 19 Jan 2025 16:44:00 -0700 Subject: [PATCH 09/14] change use of USE_AA --- src/PowerNetworkMatrices.jl | 2 ++ test/test_ptdf.jl | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/PowerNetworkMatrices.jl b/src/PowerNetworkMatrices.jl index c4f85dd9..056b0e4b 100644 --- a/src/PowerNetworkMatrices.jl +++ b/src/PowerNetworkMatrices.jl @@ -39,6 +39,8 @@ end @static if Sys.isapple() using AppleAccelerate + const USE_AA = true +else const USE_AA = false end diff --git a/test/test_ptdf.jl b/test/test_ptdf.jl index a04eed57..a6518412 100644 --- a/test/test_ptdf.jl +++ b/test/test_ptdf.jl @@ -1,8 +1,8 @@ @testset "Test PTDF matrices, w/ and w/o tolerance" begin sys5 = PSB.build_system(PSB.PSITestSystems, "c_sys5") for solver in ["KLU", "Dense", "MKLPardiso"] - if !PowerNetworkMatrices.USE_AA && solver == "MKLPardiso" - @info "Skippe MKLPardiso tests on Apple" + if PowerNetworkMatrices.USE_AA && solver == "MKLPardiso" + @info "Skipped MKLPardiso tests on Apple" continue end for approach in ["standard", "separate_matrices"] @@ -217,7 +217,9 @@ end P5_1 = PTDF(sys5; dist_slack = slack_array, linear_solver = "KLU") P5_2 = PTDF(sys5; dist_slack = slack_array, linear_solver = "Dense") - P5_3 = PTDF(sys5; dist_slack = slack_array, linear_solver = "MKLPardiso") + if !PowerNetworkMatrices.USE_AA + P5_3 = PTDF(sys5; dist_slack = slack_array, linear_solver = "MKLPardiso") + end @test isapprox(P5_1.data, P5_2.data, atol = 1e-5) @test isapprox(P5_1.data, P5_3.data, atol = 1e-5) From 407db036375bba3ea8452c865c774438d17eae69 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sun, 19 Jan 2025 16:44:38 -0700 Subject: [PATCH 10/14] add mac again to tests --- .github/workflows/pr_testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_testing.yml b/.github/workflows/pr_testing.yml index c7d37a2c..ee99371f 100644 --- a/.github/workflows/pr_testing.yml +++ b/.github/workflows/pr_testing.yml @@ -12,7 +12,7 @@ jobs: matrix: julia-version: ['1'] julia-arch: [x64] - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest, windows-latest, macOS-latest] steps: - uses: actions/checkout@v2 From 89039691133a6832055f42431a559f40b0afcac7 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sun, 19 Jan 2025 16:49:11 -0700 Subject: [PATCH 11/14] more test fixing --- test/test_lodf.jl | 2 +- test/test_ptdf.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_lodf.jl b/test/test_lodf.jl index 2810f120..ab3c470a 100644 --- a/test/test_lodf.jl +++ b/test/test_lodf.jl @@ -26,10 +26,10 @@ L5NS_from_ptdf2 = LODF(A, P5; linear_solver = "Dense") if !PowerNetworkMatrices.USE_AA L5NS_from_ptdf3 = LODF(A, P5; linear_solver = "MKLPardiso") + @test getindex(L5NS_from_ptdf3, "5", "6") - -0.3071 <= 1e-4 end @test getindex(L5NS_from_ptdf, "5", "6") - -0.3071 <= 1e-4 @test getindex(L5NS_from_ptdf2, "5", "6") - -0.3071 <= 1e-4 - @test getindex(L5NS_from_ptdf3, "5", "6") - -0.3071 <= 1e-4 total_error = abs.(L5NS_from_ptdf.data' .- Lodf_5) total_error2 = abs.(L5NS_from_ptdf2.data' .- Lodf_5) total_error3 = abs.(L5NS_from_ptdf3.data' .- Lodf_5) diff --git a/test/test_ptdf.jl b/test/test_ptdf.jl index a6518412..2aff341b 100644 --- a/test/test_ptdf.jl +++ b/test/test_ptdf.jl @@ -219,11 +219,11 @@ end P5_2 = PTDF(sys5; dist_slack = slack_array, linear_solver = "Dense") if !PowerNetworkMatrices.USE_AA P5_3 = PTDF(sys5; dist_slack = slack_array, linear_solver = "MKLPardiso") + @test isapprox(P5_2.data, P5_3.data, atol = 1e-5) end @test isapprox(P5_1.data, P5_2.data, atol = 1e-5) @test isapprox(P5_1.data, P5_3.data, atol = 1e-5) - @test isapprox(P5_2.data, P5_3.data, atol = 1e-5) end @testset "Test PTDF matrix with distributed bus and with 2 reference buses" begin From 90d7155707a0ff962723ead6a802f37733136622 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sun, 19 Jan 2025 16:52:32 -0700 Subject: [PATCH 12/14] more test fixes --- test/test_lodf.jl | 13 +++++++------ test/test_ptdf.jl | 5 ++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/test_lodf.jl b/test/test_lodf.jl index ab3c470a..1e621c6a 100644 --- a/test/test_lodf.jl +++ b/test/test_lodf.jl @@ -24,18 +24,19 @@ P5 = PTDF(sys5) L5NS_from_ptdf = LODF(A, P5) L5NS_from_ptdf2 = LODF(A, P5; linear_solver = "Dense") - if !PowerNetworkMatrices.USE_AA - L5NS_from_ptdf3 = LODF(A, P5; linear_solver = "MKLPardiso") - @test getindex(L5NS_from_ptdf3, "5", "6") - -0.3071 <= 1e-4 - end @test getindex(L5NS_from_ptdf, "5", "6") - -0.3071 <= 1e-4 @test getindex(L5NS_from_ptdf2, "5", "6") - -0.3071 <= 1e-4 total_error = abs.(L5NS_from_ptdf.data' .- Lodf_5) total_error2 = abs.(L5NS_from_ptdf2.data' .- Lodf_5) - total_error3 = abs.(L5NS_from_ptdf3.data' .- Lodf_5) @test isapprox(sum(total_error), 0.0, atol = 1e-3) @test isapprox(sum(total_error2), 0.0, atol = 1e-3) - @test isapprox(sum(total_error3), 0.0, atol = 1e-3) + + if !PowerNetworkMatrices.USE_AA + L5NS_from_ptdf3 = LODF(A, P5; linear_solver = "MKLPardiso") + @test getindex(L5NS_from_ptdf3, "5", "6") - -0.3071 <= 1e-4 + total_error3 = abs.(L5NS_from_ptdf3.data' .- Lodf_5) + @test isapprox(sum(total_error3), 0.0, atol = 1e-3) + end # A, ABA, and BA case ABA = ABA_Matrix(sys5; factorize = true) diff --git a/test/test_ptdf.jl b/test/test_ptdf.jl index 2aff341b..333167ca 100644 --- a/test/test_ptdf.jl +++ b/test/test_ptdf.jl @@ -217,13 +217,12 @@ end P5_1 = PTDF(sys5; dist_slack = slack_array, linear_solver = "KLU") P5_2 = PTDF(sys5; dist_slack = slack_array, linear_solver = "Dense") + @test isapprox(P5_1.data, P5_2.data, atol = 1e-5) if !PowerNetworkMatrices.USE_AA P5_3 = PTDF(sys5; dist_slack = slack_array, linear_solver = "MKLPardiso") @test isapprox(P5_2.data, P5_3.data, atol = 1e-5) + @test isapprox(P5_1.data, P5_3.data, atol = 1e-5) end - - @test isapprox(P5_1.data, P5_2.data, atol = 1e-5) - @test isapprox(P5_1.data, P5_3.data, atol = 1e-5) end @testset "Test PTDF matrix with distributed bus and with 2 reference buses" begin From 10d92f7975bd1315835947303d277c72c570a1d7 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sun, 19 Jan 2025 17:01:45 -0700 Subject: [PATCH 13/14] fix broken test using PSB --- test/test_ybus.jl | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/test/test_ybus.jl b/test/test_ybus.jl index 99c72b89..796e8bef 100644 --- a/test/test_ybus.jl +++ b/test/test_ybus.jl @@ -34,22 +34,14 @@ @test Ybus5[buses_5[1], buses_5[2]] == (-3.5234840209999647 + 35.234840209999646im) - c_sys5_re() = System( - 100.0, - buses_5, - thermal_generators5(buses_5), - loads5(buses_5), - branches5(buses_5), - ) - - t_sys5_re = c_sys5_re() + t_sys5_re = PSB.build_system(PSB.PSITestSystems, "c_sys5") # Make 2 islands. Island 1: 1 - 5. Island 2: 2, 3 ,4 remove_component!(Line, t_sys5_re, "1") remove_component!(Line, t_sys5_re, "2") remove_component!(Line, t_sys5_re, "6") @test_throws IS.DataFormatError Ybus(t_sys5_re) - t2_sys5_re = c_sys5_re() + t2_sys5_re = PSB.build_system(PSB.PSITestSystems, "c_sys5") # Remove lines. Don't cause islands remove_component!(Line, t2_sys5_re, "3") remove_component!(Line, t2_sys5_re, "5") From e0a460da5b5ea973454336cd10ef866eaf0808ba Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sun, 19 Jan 2025 17:18:07 -0700 Subject: [PATCH 14/14] bump PNM version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index ca508519..99b62cb2 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PowerNetworkMatrices" uuid = "bed98974-b02a-5e2f-9fe0-a103f5c450dd" authors = ["Jose Daniel Lara", "Alessandro Francesco Castelli", "Sourabh Dalvi"] -version = "0.11.2" +version = "0.12.0" [deps] DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"