Skip to content

Commit a344b01

Browse files
authored
Merge pull request #1591 from NREL-Sienna/jd/fix_typo_in_function
fix missing s
2 parents 6099c62 + ca3f076 commit a344b01

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ _*.jl
99
## Autogenerated code during the documentation process
1010
generated*.md
1111

12+
*.raw
13+
1214
# Test data
1315
data
1416

src/PowerSystems.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ export get_subsystem_components
541541
export remove_component_from_subsystem!
542542
export remove_component_from_subsystems!
543543
export has_component
544+
export has_components
544545
export get_assigned_subsystems
545546
export has_subsystems
546547
export is_assigned_to_subsystem

src/base.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,8 +1254,8 @@ end
12541254
"""
12551255
Check to see if the component of type T exists.
12561256
"""
1257-
function has_component(sys::System, T::Type{<:Component})
1258-
return IS.has_component(sys.data, T)
1257+
function has_components(sys::System, T::Type{<:Component})
1258+
return IS.has_components(sys.data.components, T)
12591259
end
12601260

12611261
"""

test/test_system.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,12 @@ end
638638
@test_throws ArgumentError add_service!(device2, service1, sys2)
639639
end
640640

641+
@testset "Test has_components" begin
642+
sys1 = PSB.build_system(PSITestSystems, "test_RTS_GMLC_sys")
643+
@test has_components(sys1, ThermalStandard)
644+
@test !has_components(sys1, TransmissionInterface)
645+
end
646+
641647
@testset "Test set_bus_number!" begin
642648
sys = PSB.build_system(PSITestSystems, "test_RTS_GMLC_sys")
643649
buses = collect(get_components(ACBus, sys))

0 commit comments

Comments
 (0)