Skip to content

Commit

Permalink
Merge pull request #15 from invenia/sm/mutable
Browse files Browse the repository at this point in the history
Make PTDF droppable
  • Loading branch information
Sam Morrison authored Jun 29, 2022
2 parents 9b2fb22 + f1cd0f9 commit 37aebb0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "FullNetworkSystems"
uuid = "877b7152-b508-43dc-81fb-72341a693988"
authors = ["Invenia Technical Computing Corporation"]
version = "1.2.0"
version = "1.3.0"

[deps]
AxisKeys = "94b1ba4f-4ee9-5380-92f1-94cde586c3c5"
Expand Down
8 changes: 4 additions & 4 deletions src/system.jl
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ Subtype of a `System` for modelling the day-ahead market.
Fields:
$TYPEDFIELDS
"""
struct SystemDA <: System
mutable struct SystemDA <: System
"`Dictionary` where the keys are bus names and the values are generator ids at that bus"
gens_per_bus::Dictionary{BusName, Vector{Int}}
"`Dictionary` where the keys are bus names and the values are increment bid ids at that bus"
Expand Down Expand Up @@ -330,7 +330,7 @@ struct SystemDA <: System
Power transfer distribution factor of the system. `KeyedArray` where the axis keys are
`branch names x bus names`
"""
ptdf::KeyedArray{Float64, 2}
ptdf::Union{KeyedArray{Float64, 2}, Missing}

# Generator related time series
"Generator related time series data"
Expand Down Expand Up @@ -359,7 +359,7 @@ Subtype of a `System` for modelling the real-time market.
Fields:
$TYPEDFIELDS
"""
struct SystemRT <: System
mutable struct SystemRT <: System
"`Dictionary` where the keys are bus names and the values are generator ids at that bus"
gens_per_bus::Dictionary{BusName, Vector{Int}}
"`Dictionary` where the keys are bus names and the values are load ids at that bus"
Expand All @@ -383,7 +383,7 @@ struct SystemRT <: System
Power transfer distribution factor of the system. `KeyedArray` where the axis keys are
`branch names x bus names`
"""
ptdf::KeyedArray{Float64, 2}
ptdf::Union{KeyedArray{Float64, 2}, Missing}

# Generator related time series
"Generator related time series data"
Expand Down
4 changes: 4 additions & 0 deletions test/system.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@
@test zero_bp == ["3"]
@test one_bp == String[] #unmonitored
@test two_bp == ["1", "4"]

# Check that we can remove the PTDF
system.ptdf = missing
@test system.ptdf === missing
end

@testset "SystemDA only accessors" begin
Expand Down

0 comments on commit 37aebb0

Please sign in to comment.