Fix slack variable detection in categorize_data#71
Closed
PabloBotinGP wants to merge 2 commits into
Closed
Conversation
…enna-Platform#68) * Initial plan * Update legacy org, docs domain, and Slack workspace references Agent-Logs-Url: https://github.com/Sienna-Platform/PowerAnalytics.jl/sessions/f7d7ad47-b1c6-439f-a209-13e78403092c Co-authored-by: jd-lara <16385323+jd-lara@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jd-lara <16385323+jd-lara@users.noreply.github.com>
Member
|
@copilot resolve the merge conflicts in this pull request |
Member
|
closed in favor of #73 |
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.
categorize_datawas supposed to label slack variables as "Unserved Energy" and "Over Generation" in its output, but it silently dropped them, so those keys never appeared in the result. Any dispatch run with infeasibility was therefore missing those.The problem wqas that in
src/get_data.jl:612, the substring needle was built withstring(slack), whereslackis aDataTypelikePSI.SystemBalanceSlackDown. In Julia,string(SomeType)returns the fully qualified name ("PowerSimulations.SystemBalanceSlackDown"). But PSI result keys are bare (:SystemBalanceSlackDown__System, no module prefix), so theoccursincheck never matched and the loop body never ran.The fix:
string(slack)→string(nameof(slack)). 'nameofreturns just the bare type name (:SystemBalanceSlackDown`), which matches the PSI key format.A new
@testsetintest/test_result_sorting.jlbuilds a syntheticDict{Symbol, DataFrame}with keys:SystemBalanceSlackUp__Systemand:SystemBalanceSlackDown__System, callscategorize_data, and asserts that both"Unserved Energy"and"Over Generation"appear in the output, mapped to the original DataFrames.Changes are minimal but they seem to be more because I run the JuliaFormatter which fixed many different things.
closes #46