Repository navigation
Refactor voltage filter: grid-detected clustering and <25kV bucketing - #27
Merged
Merged
Conversation
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.
Walkthrough - Voltage Filter Bucketing
I have implemented a bucketing workaround for small voltages (< 25kV) to prevent the filter slider from becoming cluttered.
Changes
Updated
network_service.py
to:
Group all identified nominal voltages below 25kV into a single bucket.
This allows the user to filter all low-voltage lines (e.g., 20kV, 15kV, 3.3kV) at once with a single slider step.
2. UI Labeling
Updated
VisualizationPanel.tsx
to:
Explicitly label the bottom bucket as "<25" in the slider ticks.
This provides clear feedback that the entire low-voltage range is being controlled together.
Verification
Automated Tests
I successfully ran a new test script
run_bucket_test.py
verifying that:
Cluster averages below 25kV (e.g., 20kV, 3.3kV) all map to the same 25.0 value.
The unique voltages list correctly consolidates these into a single entry.
Manual Verification
The "kV Filter" sidebar now shows a single step for all voltages below 25kV, labeled "<25". High-voltage levels (e.g., 400kV, 225kV) remain as individual, clean ticks. This drastically simplifies the interface while maintaining full functionality for filtering the grid's core infrastructure.