Add paper-aligned trap metrics, top-sector parameter, and layer aggregation with tests#358
Open
charlesmartin14 wants to merge 14 commits intomasterfrom
Open
Add paper-aligned trap metrics, top-sector parameter, and layer aggregation with tests#358charlesmartin14 wants to merge 14 commits intomasterfrom
charlesmartin14 wants to merge 14 commits intomasterfrom
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.
Motivation
top_sector_lparameter so top-sector overlap can be computed reproducibly and aggregated per layer.Description
top_sector_lparameter toanalyze_trapsin both the top-level API and internaltrap_analysis.analyze_traps, with validation that it is>= 1.WeightWatcher:compute_trap_delta,compute_trap_ipr_q,compute_top_sector_overlap, andcompute_trap_variance_burden, and used them when constructing each trap row to populate new columnstrap_delta,trap_ipr,trap_q,trap_diffuseness,top_sector_l,top_sector_l_effective,trap_top_sector_overlap, andtrap_variance_burden.layer_trap_variance_burdencomputed by groupingtrap_variance_burdenbylayer_idintrap_analysis.analyze_trapsand included the new metric columns in_trap_result_columnsso they appear indetails.tests/test_analyze_traps.pywith unit tests that exercise the helper functions, assert the presence of the new paper-aligned columns, validatetop_sector_lbehavior, verify the variance-burden formula rowwise, and check the per-layer aggregation.Testing
pytest tests/test_analyze_traps.pyand the updated test suite for the helper functions, and all tests passed.compute_trap_delta,compute_trap_ipr_q,compute_top_sector_overlap, the presence of new DataFrame columns, thetop_sector_largument behavior, the rowwise variance-burden formula, and thelayer_trap_variance_burdenaggregation.Codex Task