Improve test coverage from 72% to 80% with 68 new test cases - #2
Merged
Conversation
Cover all previously untested code paths: - Empty graph handling in plot_degree_comparison - Linear scale (log_scale=False) and show_lines=True branches - Custom graph parameters and pre-created axes - No common voltage levels edge cases - plot_level_topology_comparison full path - plot_all_levels_comparison with single and multiple levels - run_full_comparison integration test Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: cookbook-ms <92166253+cookbook-ms@users.noreply.github.com>
- test_transformer_edges: 4 new tests covering the bipartite Chung-Lu fallback path (lines 105, 120, 138-156) with leftover X, leftover Y, both leftovers, and large-center-insufficient-leaves scenarios. - test_transmission: 6 new tests covering _assign_betas empty case, allocate on empty graph, allocate with refine_topology=True, _generate_beta sorted output, _generate_beta no-zeros guard, and fallback ref_sys_id. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: cookbook-ms <92166253+cookbook-ms@users.noreply.github.com>
…ut_configurator - test_reference_data: Add tests for invalid ref_sys_id (ValueError), system names, and PMF validation (Tab_2D_Pgmax sums to ~1). Covers else branch. - test_bus_type_allocation: Add TestBusTypeAllocator class with 12 unit tests covering _normalize_ratio validation, _get_ratios size thresholds, custom bus_type_ratio, _calculate_bus_ratios empty case, entropy_model=1 path, _get_d_parameter branches, and allocate output. - test_input_config: Add 8 tests covering _generate_optimized_degrees (dgln/dpl), _generate_transformer_simple, create_params with k-stars/simple connections, multiple levels, invalid connection index, and non-negative Poisson degrees. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: cookbook-ms <92166253+cookbook-ms@users.noreply.github.com>
…atcher, and deg_dist_optimizer - test_capacity_allocator: Add 4 tests covering ref_sys_id=0 heuristic path, no-generator allocation, heuristic table shape, and n_gen=0 distribution - test_generation_dispatch: Add 5 tests covering no-generator dispatch, empty uncommitted selection, alpha_mod!=0 path, zero-count alphas, and invalid ref_sys_id fallback - test_deg_dist_optimizer: Add 6 tests covering extreme params fallback, unknown type errors, verbose output, power-law decreasing property, and objective function penalty behavior Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: cookbook-ms <92166253+cookbook-ms@users.noreply.github.com>
Agent-Logs-Url: https://github.com/cookbook-ms/Chung_Lu_Chain-synthesizer/sessions/58737d92-86d1-434e-9067-8b4599ffcae4 Co-authored-by: cookbook-ms <92166253+cookbook-ms@users.noreply.github.com>
Agent-Logs-Url: https://github.com/cookbook-ms/Chung_Lu_Chain-synthesizer/sessions/58737d92-86d1-434e-9067-8b4599ffcae4 Co-authored-by: cookbook-ms <92166253+cookbook-ms@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
cookbook-ms
April 7, 2026 12:43
View session
cookbook-ms
marked this pull request as ready for review
April 7, 2026 13:19
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.
Analyzed test coverage across the codebase and added targeted tests for undertested modules, focusing on edge cases, error handling, fallback paths, and alternative code branches.
Coverage improvements by module
run_full_comparisonplot_entropy_pdf,_generate_random_assignmentfallback when non-leaf nodes are insufficient_generate_optimized_degrees(dgln/dpl),_generate_transformer_simple,create_paramswith simple connection typealpha_mod != 0branches (negative dispatch), empty generator handling, invalid ref_sys_id fallbackrefine_topology=True,_assign_betasempty caseKnown uncovered areas (intentional)
except RuntimeWarning(numpy raises warnings, not exceptions)