Repository navigation
One way to draw the seed an unseeded multi-run result shares - #507
Merged
Merged
Conversation
npv_distribution, compare_npv, least_spend_for_downtime, best_switch_time, RepairOrReplace's unit decisions and value_plan's requests drew the seed their runs share from OS entropy, which np.random.seed did not reach. They now take it through _streams.shared_seed, as cost_by_window does. Seeded results are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6RpnXB87vwhYETeh7ihtA
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
Results made of several runs on one seed drew that seed, when none was given, from the operating system's entropy, which
np.random.seeddoes not reach. They now take it throughrbd._streams.shared_seed, ascost_by_windowalready does, so an unseeded call is repeatable undernp.random.seedand is the seeded call of the seed drawn:npv_distribution,compare_npv,least_spend_for_downtime(through_npv_runs._seed)best_switch_time(_switch_runs)RepairOrReplace.unit_decision/unit_decisionswith uncertaintyvalue_planrequests for a seeded analysis (_contract)Each
seeddocstring says how an unseeded call draws its seed. Seeded results are unchanged.Type of change
Checklist
test_shared_seeds.py: each call unseeded undernp.random.seed(k)against the seeded call of the seed drawn)test_shared_seeds,test_npv_distribution,test_switch_time_diagram,test_repair_or_replace,test_value_plan,test_downtime_risk,test_window_report(98 passed, 1 skipped) and the touched modules' doctests (9 passed)CHANGELOG.mdupdated under[Unreleased]Notes for reviewers
RepairOrReplace.fleet_policywithout a seed still draws its own bands from fresh entropy: it is one draw, not runs that must share a seed.Generated by Claude Code