Skip to content

Forward delete_existing kwarg in transform_single_time_series!#1650

Open
daniel-thom wants to merge 1 commit intomainfrom
is-issue-557
Open

Forward delete_existing kwarg in transform_single_time_series!#1650
daniel-thom wants to merge 1 commit intomainfrom
is-issue-557

Conversation

@daniel-thom
Copy link
Copy Markdown
Contributor

@daniel-thom daniel-thom commented Apr 3, 2026

Companion PR to NREL-Sienna/InfrastructureSystems.jl#562

CI will fail until IS is released and tagged.

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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 the delete_existing option.
  • Adds a delete_existing::Bool = true keyword argument to transform_single_time_series!.
  • Forwards delete_existing through to IS.transform_single_time_series!.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 1986 to +1991
function transform_single_time_series!(
sys::System,
horizon::Dates.Period,
interval::Dates.Period;
resolution::Union{Nothing, Dates.Period} = nothing,
delete_existing::Bool = true,
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@daniel-thom daniel-thom requested a review from jd-lara April 3, 2026 17:38
@daniel-thom daniel-thom marked this pull request as ready for review April 3, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants