Skip to content

Commit

Permalink
Merge pull request #45 from Welthulk/dev/0.4.17
Browse files Browse the repository at this point in the history
Hotfix wrong function call
  • Loading branch information
sudo-ac authored Apr 14, 2024
2 parents 2c72569 + 94244bb commit 4ddfe51
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "Sparlectra"
uuid = "31ce9bba-fd9d-44a1-b005-f5f509afda38"
authors = ["Udo Schmitz"]
description = "load flow calculation using newton-raphson"
version = "0.4.16"
version = "0.4.17"

[deps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Expand Down
11 changes: 9 additions & 2 deletions docs/src/changelog.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# Change Log
## Version 0.4.16 (2024-04-17)
## Version 0.4.17 (2024-04-14)
### New Features
- added testcase for importing Matpower files

### Bug Fixes
- bugfix wrong function call in `createnet_powermat`

## Version 0.4.16 (2024-04-13)
### New Features

### Bug Fixes
- bugfix shunt index for isolated buses, closes issue #38

## Version 0.4.15 (2024-04-16)
## Version 0.4.15 (2024-04-12)
### New Features
- Implemented a function to detect isolated buses and incorporate them into the network calculation (Issue #38)
### Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions src/Sparlectra.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Sparlectra 0.4.16
Sparlectra 0.4.17
Sparlectra is a Julia package for the calculation of electrical networks. It is designed to be used in the context of power system analysis and optimization.
Expand Down Expand Up @@ -27,7 +27,7 @@ using LinearAlgebra, SparseArrays, Printf, Logging

# resource data types for working with Sparlectra
const Wurzel3 = 1.7320508075688772
const SparlectraVersion = VersionNumber("0.4.16")
const SparlectraVersion = VersionNumber("0.4.17")
abstract type AbstractBranch end

export
Expand Down
2 changes: 1 addition & 1 deletion src/createnet_powermat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ function createNetFromMatPowerFile(filename, log::Bool = false)::Net
addProsumer!(net = myNet, busName = bus, type = "GENERATOR", vm_pu = vm_pu, referencePri = referencePri, p = pGen, q = qGen, pMax = pMax, pMin = pMin, qMax = qMax, qMin = qMin)
end# read Generators

erg, msg = validate(net = myNet)
erg, msg = validate!(net = myNet)
if erg == false
@error "network is invalid: $msg"
end
Expand Down
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ include("testgrid.jl")
@test test_NBI_MDO() == true
@test test_acpflow(0) == true
@test testISOBusses() == true
# @test testImportMatpower() == true # This test is not working because the file is not found in github
end
25 changes: 20 additions & 5 deletions test/testgrid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,26 @@ function testExportMatpower()
return true
end

function testImportMatpower()
mdo = true
log = false
net = createNetFromMatPowerFile(getTestFilePathName(), 0.0, log, mdo)
return validate!(net = net)
function testImportMatpower()
filename = "case5.m"
path = joinpath(pwd(), "data", "mpower", filename)

net = createNetFromMatPowerFile(path, false)
if strip(net.name) != "case5"
@warn "Failed to import network case5.m from file: $path"
return false
end

if length(net.nodeVec) != 5
@warn "Expected 5 nodes, found: $(length(net.nodeVec))"
return false
end
if length(net.branchVec) != 5
@warn "Expected 5 branches, found: $(length(net.branchVec))"
return false
end

return true
end

function rmTestfiles()
Expand Down

0 comments on commit 4ddfe51

Please sign in to comment.