Skip to content

Commit

Permalink
Merge branch 'main' into hr/psse_parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-lara authored Mar 19, 2024
2 parents a982911 + 4587ed0 commit 4999e39
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PowerSystems"
uuid = "bcd98974-b02a-5e2f-9ee0-a103f5c450dd"
authors = ["Jose Daniel Lara", "Daniel Thom", "Dheepak Krishnamurthy", "Clayton Barrows", "Sourabh Dalvi"]
version = "3.2.3"
version = "3.3.0"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand Down
8 changes: 5 additions & 3 deletions src/models/components.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
function get_system_base_power(c::Component)
return get_internal(c).units_info.base_value
end

"""
Default behavior of a component. If there is no base_power field, assume is in the system's base power.
"""
function get_base_power(c::Component)
return get_internal(c).units_info.base_value
end
get_base_power(c::Component) = get_system_base_power(c)

function _get_multiplier(c::T) where {T <: Component}
setting = get_internal(c).units_info
Expand Down
4 changes: 4 additions & 0 deletions test/test_dynamic_generator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,10 @@ end
@test get_dynamic_injector(static_gen) === Gen2AVR
@test get_base_power(static_gen) == get_base_power(Gen2AVR)

set_base_power!(static_gen, 1234.5)
@test get_base_power(static_gen) == 1234.5
@test PSY.get_system_base_power(static_gen) == get_base_power(sys)

# Rule: Can't set the pair injector if the current injector is already set.
@test_throws ArgumentError set_dynamic_injector!(static_gen, Gen1AVR)

Expand Down

0 comments on commit 4999e39

Please sign in to comment.