Forward delete_existing kwarg in transform_single_time_series!#1650
Forward delete_existing kwarg in transform_single_time_series!#1650daniel-thom wants to merge 1 commit intomainfrom
Conversation
Companion change to NREL-Sienna/InfrastructureSystems.jl#562. Exposes the new delete_existing kwarg (default true for backwards compatibility) through the PowerSystems wrapper. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds support for controlling whether existing deterministic forecasts are removed when transforming SingleTimeSeries into DeterministicSingleTimeSeries, aligning the System-level convenience wrapper with the underlying InfrastructureSystems.transform_single_time_series! API.
Changes:
- Updates
transform_single_time_series!docstring to describe default deletion behavior and thedelete_existingoption. - Adds a
delete_existing::Bool = truekeyword argument totransform_single_time_series!. - Forwards
delete_existingthrough toIS.transform_single_time_series!.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| function transform_single_time_series!( | ||
| sys::System, | ||
| horizon::Dates.Period, | ||
| interval::Dates.Period; | ||
| resolution::Union{Nothing, Dates.Period} = nothing, | ||
| delete_existing::Bool = true, |
There was a problem hiding this comment.
New delete_existing keyword behavior is user-facing but currently has no direct test coverage. Consider adding a test that (1) creates a System with existing DeterministicSingleTimeSeries, (2) calls transform_single_time_series! with delete_existing=false and asserts existing forecasts remain and duplicates are skipped, and (3) calls with the default (true) and asserts forecasts are removed/replaced. This will prevent regressions in the wrapper/forwarding behavior.
Companion PR to NREL-Sienna/InfrastructureSystems.jl#562
CI will fail until IS is released and tagged.