You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
help?> remove_supplemental_attribute!
search: remove_supplemental_attribute! remove_supplemental_attributes! iterate_supplemental_attributes get_supplemental_attributes
remove_supplemental_attribute!(
sys::System,
component::Component,
attribute::SupplementalAttribute
)
Remove the supplemental attribute from the component. The attribute will be removed from the system if it is not attached to any other
component.
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
remove_supplemental_attribute!(
sys::System,
attribute::SupplementalAttribute
)
Remove the supplemental attribute from the system and all attached components.
julia> a =get_supplemental_attributes(x->x.geo_json["coordinates"] == [0.0,0.0], GeographicInfo, sys) |> first
GeographicInfo:3add1158-d1d8-428d-ab2b-cd6096b6c0ee:
geo_json:Dict{String, Any}("coordinates"=> Any[0, 0], "type"=>"Point")
has_time_series:false
julia>remove_supplemental_attribute!(sys, a)
ERROR: MethodError: no method matching remove_supplemental_attribute!(::InfrastructureSystems.SystemData, ::GeographicInfo)
The function`remove_supplemental_attribute!` exists, but no method is defined for this combination of argument types.
Closest candidates are:remove_supplemental_attribute!(::InfrastructureSystems.SystemData, ::InfrastructureSystems.InfrastructureSystemsComponent, ::SupplementalAttribute)
@ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/nVUI1/src/system_data.jl:1195remove_supplemental_attribute!(::InfrastructureSystems.SupplementalAttributeManager, ::SupplementalAttribute)
@ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/nVUI1/src/supplemental_attribute_manager.jl:157remove_supplemental_attribute!(::InfrastructureSystems.SupplementalAttributeManager, ::InfrastructureSystems.InfrastructureSystemsComponent, ::SupplementalAttribute)
@ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/nVUI1/src/supplemental_attribute_manager.jl:145
Stacktrace:
[1] remove_supplemental_attribute!(sys::System, attribute::GeographicInfo)
@ PowerSystems ~/.julia/packages/PowerSystems/azBUB/src/base.jl:1665
[2] top-level scope
@ REPL[49]:1
The text was updated successfully, but these errors were encountered:
There is a disconnect between PSY and IS, and I don't recall why. IS quite explicitly does not allow removal of a single attribute. The SystemData struct does not implement the method, as shown in the stack trace. The SupplementalAttributesManager does implement the method. However, it will fail if the attribute is still attached to a component.
I don't recall if this is the intended behavior and if we/I just forgot to delete the PSY method.
If @jd-lara remembers the history, let me know. Otherwise, let's just focus on what we want. This hasn't worked in a long time, if ever.
A user cannot add a supplemental attribute by itself, so these methods are symmetric. Also, one could argue that, despite the docstring, implicit disconnection from components may not be obvious.
The text was updated successfully, but these errors were encountered: