Skip to content

Commit

Permalink
Merge pull request #16 from invenia/bes/table_types
Browse files Browse the repository at this point in the history
Add and export table types for static components
  • Loading branch information
BSnelling authored Jun 30, 2022
2 parents 37aebb0 + 099486f commit eb5b435
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
1 change: 1 addition & 0 deletions src/FullNetworkSystems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ using InlineStrings

export System, SystemDA, SystemRT
export Zone, Generator, Bus, Branch
export Zones, Generators, Buses, Branches
export GeneratorTimeSeries, GeneratorStatus, GeneratorStatusDA, GeneratorStatusRT
export gens_per_zone, branches_by_breakpoints, get_datetimes
export get_zones, get_buses, get_generators, get_branches, get_lines, get_transformers
Expand Down
34 changes: 19 additions & 15 deletions src/system.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const MARKET_WIDE_ZONE = -9999
const BidName = InlineString31
const ZoneNum = Int64
"""
$TYPEDEF
Expand All @@ -11,20 +13,17 @@ $TYPEDFIELDS
"""
struct Zone
"Zone number"
number::Int64
number::ZoneNum
"Zonal regulation requirement (pu)"
regulation::Float64
"Zonal operating reserve requirement (regulation + spinning + supplemental) (pu)"
operating_reserve::Float64
"Zonal good utility practice requirement (regulation + spinning) (pu)"
good_utility::Float64
end
const Zones = Dictionary{ZoneNum, Zone}

###### Static Component Types ######
const BusName = InlineString15
const BranchName = InlineString31
const BidName = InlineString31

const UnitCode = Int64
"""
$TYPEDEF
Expand All @@ -36,7 +35,7 @@ $TYPEDFIELDS
"""
struct Generator
"Generator id/unit code"
unit_code::Int
unit_code::UnitCode
"Number of the zone the generator is located in"
zone::Int
"Cost of turning on the generator (\$)"
Expand All @@ -56,7 +55,9 @@ struct Generator
"Symbol describing the technology of the generator"
technology::Symbol
end
const Generators = Dictionary{UnitCode, Generator}

const BusName = InlineString15
"""
$TYPEDEF
Expand All @@ -71,7 +72,9 @@ struct Bus
"Base voltage (kV)"
base_voltage::Float64
end
const Buses = Dictionary{BusName, Bus}

const BranchName = InlineString31
"""
$TYPEDEF
Expand Down Expand Up @@ -112,6 +115,7 @@ struct Branch
"Phase shift angle (radians)"
angle::Union{Missing, Float64}
end
const Branches = Dictionary{BranchName, Branch}

"""
Constructors for a `Branch`. The user has the option to define a `Branch` as a line e.g.
Expand Down Expand Up @@ -313,13 +317,13 @@ mutable struct SystemDA <: System
loads_per_bus::Dictionary{BusName, Vector{BidName}}

"Zones in the `System`, which will also include a `Zone` entry for the market wide zone"
zones::Dictionary{Int, Zone}
zones::Zones
"Buses in the `System` indexed by bus name"
buses::Dictionary{BusName, Bus}
buses::Buses
"Generators in the `System` indexed by unit code"
generators::Dictionary{Int, Generator}
generators::Generators
"Branches in the `System` indexed by branch name"
branches::Dictionary{BranchName, Branch}
branches::Branches
"""
The line outage distribution factor matrix of the system for a set of contingencies given
by the keys of the `Dictionary`. Each entry is a `KeyedArray` with axis keys
Expand Down Expand Up @@ -366,13 +370,13 @@ mutable struct SystemRT <: System
loads_per_bus::Dictionary{BusName, Vector{BidName}}

"Zones in the `System`, which will also include a `Zone` entry for the market wide zone"
zones::Dictionary{Int, Zone}
zones::Zones
"Buses in the `System` indexed by bus name"
buses::Dictionary{BusName, Bus}
buses::Buses
"Generators in the `System` indexed by unit code"
generators::Dictionary{Int, Generator}
generators::Generators
"Branches in the `System` indexed by branch name"
branches::Dictionary{BranchName, Branch}
branches::Branches
"""
The line outage distribution factor matrix of the system for a set of contingencies given
by the keys of the `Dictionary`. Each entry is a `KeyedArray` with axis keys
Expand Down

2 comments on commit eb5b435

@BSnelling
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/63424

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.3.0 -m "<description of version>" eb5b435bc7d11ff80d80b7e9a11a1dde99435500
git push origin v1.3.0

Please sign in to comment.