Port performance updates for parameter broadcasting#110
Closed
acostarelli wants to merge 1 commit intomainfrom
Closed
Port performance updates for parameter broadcasting#110acostarelli wants to merge 1 commit intomainfrom
acostarelli wants to merge 1 commit intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates parameter population logic to use index-based “fast-path” setters for improved performance and fixes a multiplier-row misalignment bug affecting parallel branches that share the same time-series UUID.
Changes:
- Replaced per-(name,time) parameter/multiplier setters with array-data +
_set_*_at!index-based setters across several parameter build paths. - Fixed PTDF/network-aware time-series parameter handling by using separate row lookups for the UUID-keyed parameter array vs the name-keyed multiplier array (prevents NaN multiplier rows for parallel branches).
- Added a regression test ensuring multiplier rows for parallel branches are fully populated (no NaNs).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/common_models/add_parameters.jl |
Switches to direct array writes for parameters/multipliers and corrects UUID-vs-name row addressing for parallel-branch cases. |
src/static_injector_models/hydro_generation.jl |
Uses direct array writes when building hydro-related parameters to reduce setter overhead. |
test/test_parallel_branch_parameter_multipliers.jl |
Adds regression coverage to ensure parallel-branch multiplier rows aren’t left as NaN. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+553
to
+554
| for (i, (ts_name, device_name, device)) in | ||
| enumerate(zip(ts_names, device_names, active_devices)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sienna-Platform/PowerSimulations.jl#1609
Requires Sienna-Platform/InfrastructureOptimizationModels.jl#95