Conversation
Codecov Report❌ Patch coverage is
... and 10 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
I updated the identification of strategic periods with a new method which also throws errors if a wrong value is specified. One issue in this case is that with the current method, we cannot say with a 100 % certainty that the We can, if desired, extend the overall approach as well as the identification of a strategic period is in practice potentially something of general relevance. One issue at the moment is that is rather inefficient when |
|
I identified one approach for a proper identification: filter_sp(sp::AbstractStrategicPeriod, t::TimePeriod) = t in sp
filter_sp(sp::AbstractStrategicPeriod, t::AbstractOperationalScenario) = t in opscenarios(sp)
filter_sp(sp::AbstractStrategicPeriod, t::AbstractRepresentativePeriod) = t in repr_periods(sp)
function _sp_period(t, ts::TimeStructure)
sps = collect(strat_periods(ts))
filter_fun(sp) = filter_sp(sp, t)
per = findfirst(filter_fun, sps)
isnothing(per) && throw(ErrorException("Time period not part of any strategic period"))
return sps[per]
endThis approach identifies whether the node is exactly in the time structure compared to just checking that the sp (and branch) are correct. Note that the system also works with |
trulsf
left a comment
There was a problem hiding this comment.
I like the simplifications and doc updates. Currently, I can live with the version that identifies strategic period by index.
PR #71 introduced a new discounting method. Within the PR we identified potential for improving the overall code structure. This is now done within this PR. It can still be improved, e.g., providing types for the different discounting methods through different
Discountertypes, if desired.I furthermore did a change to API structure which is in practice rather miniscule.