feat: Add opt-in construction-attribute classification for distribution lines - #92
Open
m1muralid wants to merge 4 commits into
Open
feat: Add opt-in construction-attribute classification for distribution lines#92m1muralid wants to merge 4 commits into
m1muralid wants to merge 4 commits into
Conversation
…ranch The c_matrix threshold (> 0.05 uF/km = underground) misclassifies models whose converted underground cables carry default or low capacitance values. USE_CONSTRUCTION_ATTRIBUTE in gdm_mapping (default False, legacy behavior unchanged) switches the two distribution-line filters to the equipment's construction attribute instead. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds an opt-in switch in erad.gdm_mapping to classify distribution MatrixImpedanceBranch lines as overhead vs underground using the GDM equipment construction attribute (via LineType) instead of the legacy c_matrix capacitance threshold heuristic, while keeping default behavior unchanged.
Changes:
- Introduced
USE_CONSTRUCTION_ATTRIBUTE(defaultFalse) to toggle classification logic. - Updated the distribution underground/overhead
MatrixImpedanceBranchfilters to useequipment.constructionwhen the flag is enabled. - Added
LineTypeimport to support the new construction-based comparisons.
File summaries
| File | Description |
|---|---|
src/erad/gdm_mapping.py |
Adds an opt-in flag and updates distribution line classification filters to optionally use equipment.construction (LineType) instead of c_matrix thresholds. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+45
to
+49
| component_filter=lambda x: ( | ||
| x.equipment.construction == LineType.UNDERGROUND | ||
| if USE_CONSTRUCTION_ATTRIBUTE | ||
| else x.equipment.c_matrix[0, 0].to("microfarad/kilometer").magnitude > 0.05 | ||
| ) |
Per copilot suggestion Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…-Distribution-Suites/ERAD into mm/update_dist_line_mapping Merging upstream and downstream changes
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.
The c_matrix threshold (> 0.05 uF/km = underground) misclassifies models whose converted underground cables carry default or low capacitance values. USE_CONSTRUCTION_ATTRIBUTE in gdm_mapping (default False, legacy behavior unchanged) switches the two distribution-line filters to the equipment's construction attribute instead.
Usage:
Testing: