Skip to content

Commit

Permalink
remove technology script
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigomha committed Apr 5, 2024
1 parent 3c9283c commit b03645b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions scripts/portfolio_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ t = SupplyTechnology{ThermalStandard}(
)

PSIP.add_technology!(p, t)
PSIP.remove_technology!(SupplyTechnology{ThermalStandard}, p, "thermal_tech")
15 changes: 15 additions & 0 deletions src/portfolio.jl
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,21 @@ function remove_technology!(portfolio::Portfolio, technology::T) where {T <: Tec
return
end

"""
Remove a technology from the portfolio by its name.
Throws ArgumentError if the component is not stored.
"""
function remove_technology!(
::Type{T},
portfolio::Portfolio,
name::AbstractString,
) where {T <: Technology}
tech = IS.remove_component!(T, portfolio.data, name)
handle_technology_removal!(portfolio, tech)
return
end

"""
Throws ArgumentError if a PowerSystemsInvestmentPorfol rule blocks removal from the system.
"""
Expand Down

0 comments on commit b03645b

Please sign in to comment.