Add pipeline tests#23
Merged
Merged
Conversation
Covers N=1,2,3 intermediate poles and both to_from directions. Catches the missing pole-to-pole link that left disconnected subgraphs when breaking long distribution links.
Runs optimize() end-to-end on a 4-consumer hand-calculable grid and verifies: - all consumers grid-connected (SHS threshold is astronomically high) - no distribution or connection link exceeds its configured max length - at least one long-distance intermediate pole was inserted by _break_long_link - pole connection-link count stays within max_n_connections - every pole reachable from power house (no disconnected subgraphs)
Runs optimize() on a 3-consumer grid where one consumer (C2, 500 m from PH) is too expensive to connect and must be assigned SHS by the optimizer. Fixture design notes: - C0 and C1 are placed 40 m from PH, beyond the 30 m auto-attach threshold of _connect_power_house_consumer_manually, so they go through k-means and get a proper cluster pole that survives the SHS cut. - max_n_connections=3 so the binary-search pole finder converges to 3 clusters (PH, near, far), avoiding the k_means_constrained capacity error that would occur with 2 clusters and 3 placeholder nodes. Verifies: - C0, C1 remain grid-connected with a parent pole after the far cut - C2 is marked SHS (is_connected=False, parent=None) - no orphaned poles remain in the pruned network
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.
Add AI generated tests to check the entire optimizer pipeline, not just single units.