test: add comprehensive tests for normalize and dynamic emissions modules#187
Closed
avantikau wants to merge 1 commit intoentrius:testfrom
Closed
test: add comprehensive tests for normalize and dynamic emissions modules#187avantikau wants to merge 1 commit intoentrius:testfrom
avantikau wants to merge 1 commit intoentrius:testfrom
Conversation
…ules Add 37 unit tests covering two previously untested critical pipeline functions: normalize_rewards_linear() and apply_dynamic_emissions_using_network_contributions(). Test classes: - TestNormalizeRewardsLinear (13 tests): proportion preservation, sum-to-one invariant, zero-score handling, single miner, edge cases - TestExponentialUnlockScalar (6 tests): boundary values, monotonicity, mathematical correctness of the unlock curve - TestGetNetworkTotals (6 tests): aggregation logic, empty inputs, duplicate repo deduplication, inactive miner filtering - TestApplyDynamicEmissions (9 tests): recycling to RECYCLE_UID, emission conservation, low/high network contribution scenarios - TestNormalizeToDynamicEmissionsPipeline (3 tests): end-to-end integration verifying the full normalize -> dynamic emissions flow Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
normalize_rewards_linear()innormalize.pyandapply_dynamic_emissions_using_network_contributions()indynamic_emissions.pyTest Coverage Added
TestNormalizeRewardsLinearnormalize.pyTestExponentialUnlockScalardynamic_emissions.pyTestGetNetworkTotalsdynamic_emissions.pyTestApplyDynamicEmissionsdynamic_emissions.pyTestNormalizeToDynamicEmissionsPipelineKey scenarios tested:
RECYCLE_UID, emission conservation, low/high network contribution scenariosTest plan
pytest tests/validator/test_normalize_and_dynamic_emissions.py -v)pytest tests/ -v— 236 tests, 0 failures)🤖 Generated with Claude Code