Skip to content

Refactor voltage filter: grid-detected clustering and <25kV bucketing - #27

Merged
marota merged 1 commit into
mainfrom
refactor/voltage-filter-clustering-bucketing
Mar 2, 2026
Merged

marota merged 1 commit into
mainfrom
refactor/voltage-filter-clustering-bucketing

Conversation

@marota

@marota marota commented Mar 2, 2026

Copy link
Copy Markdown
Collaborator

Walkthrough - Voltage Filter Bucketing
I have implemented a bucketing workaround for small voltages (< 25kV) to prevent the filter slider from becoming cluttered.

Changes

  1. Low-Voltage Bucketing
    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.

@marota
marota merged commit 73f30fc into main Mar 2, 2026
@marota marota mentioned this pull request Mar 2, 2026
26 of 27 tasks
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.

1 participant