Closed kdheepak closed 1 year ago
Why would you expect for the FlattenIteratorWrapper
have a methods keys
if it isn't a dictionary? We have a method
get_components(Branch system, x -> get_name(get_from(get_arch(x))) == name)
or if you have the bus:
get_components(Branch system, x -> get_from(get_arch(x)) == bus)
What about this:
julia> branch = first(get_components(Branch, sys))
B15 (TapTransformer):
name: B15
available: true
active_power_flow: 0.0
reactive_power_flow: 0.0
arc: Balzac -> Barkla (Arc)
r: 0.002
x: 0.084
primary_shunt: 0.0
tap: 1.03
rate: 4.0
services: 0-element Vector{Service}
ext: Dict{String, Any}()
time_series_container: InfrastructureSystems.TimeSeriesContainer: 0
InfrastructureSystems.SystemUnitsSettings:
base_value: 100.0
unit_system: UnitSystem.SYSTEM_BASE = 0
julia> buses = get_components(Bus, sys)
Bus Counts:
Bus: 73
julia> findall(x -> x === get_name(get_from(get_arc(branch))), get_name.(buses))
1-element Vector{Int64}:
45
Currently
keys
is not defined forInfrastructureSystems.FlattenIteratorWrapper
.This prevents users from using functions like
findall(x -> x.name === get_from(get_arc(branch)).name, buses)
wherebuses
is aInfrastructureSystems.FlattenIteratorWrapper
.Workaround is to use
findall(x -> x.name === get_from(get_arc(branch)).name, collect(buses))
at the moment.