NREL-Sienna / InfrastructureSystems.jl

Utility package for Sienna's simulation infrastructure
https://nrel-sienna.github.io/InfrastructureSystems.jl/
BSD 3-Clause "New" or "Revised" License
39 stars 20 forks source link

Breaking change to `add_component!` in v1.4.3 #222

Closed nickrobinson251 closed 3 years ago

nickrobinson251 commented 3 years ago

in InfrastructureSystems v1.4.3, a keyword to add_component! was renamed from deserialization_in_progress -> allow_existing_time_series https://github.com/NREL-SIIP/InfrastructureSystems.jl/pull/220/files#r625452331

AFAICT add_component! is public API, so this is a breaking change.

In particular this breaks PowerSystems.jl; it causes a MethodError at https://github.com/NREL-SIIP/PowerSystems.jl/blob/v1.4.2/src/base.jl#L383-L386

Which in turn breaks our internal code (which simply calls add_component!(system, bus)), leading to PowerSystem's hitting the MethodError:

  MethodError: no method matching add_component!(::InfrastructureSystems.Components, ::Bus; deserialization_in_progress=false, skip_validation=true)
  Closest candidates are:
    add_component!(::InfrastructureSystems.Components, ::T; skip_validation, allow_existing_time_series) where T<:InfrastructureSystems.InfrastructureSystemsComponent at /root/.julia/packages/InfrastructureSystems/q6GNU/src/components.jl:34 got unsupported keyword argument "deserialization_in_progress"
    add_component!(!Matched::InfrastructureSystems.SystemData, ::Any; kwargs...) at /root/.julia/packages/InfrastructureSystems/q6GNU/src/system_data.jl:602
  Stacktrace:
    [1] kwerr(::NamedTuple{(:deserialization_in_progress, :skip_validation), Tuple{Bool, Bool}}, ::Function, ::InfrastructureSystems.Components, ::Bus)
      @ Base ./error.jl:157
    [2] add_component!(data::InfrastructureSystems.SystemData, component::Bus; kwargs::Base.Iterators.Pairs{Symbol, Bool, Tuple{Symbol, Symbol}, NamedTuple{(:deserialization_in_progress, :skip_validation), Tuple{Bool, Bool}}})
      @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/q6GNU/src/system_data.jl:602
    [3] add_component!(sys::System, component::Bus; skip_validation::Bool, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
      @ PowerSystems ~/.julia/packages/PowerSystems/RdpU1/src/base.jl:383
    [4] add_component!
      @ ~/.julia/packages/PowerSystems/RdpU1/src/base.jl:369 [inlined]
nickrobinson251 commented 3 years ago

i think this will be fixed by #221

jd-lara commented 3 years ago

@nickrobinson251 yes, this will be fixed and properly addressed with a deprecation.