Repository navigation
MNT: make the parachute noise seed private - #1227
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1227 +/- ##
========================================
Coverage 86.67% 86.67%
========================================
Files 131 131
Lines 18275 18287 +12
========================================
+ Hits 15839 15851 +12
Misses 2436 2436 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
MateusStano
left a comment
There was a problem hiding this comment.
Looks good, one problem before merging.
The noise seed recorded in each Monte Carlo input row (parachutes[i]["seed"]) is a 128-bit integer, and pandas.read_json fails on it with "Value is too big!". It is the same issue as the study seed in #1213, which only got the 63-bit fix at the top level.
It is already like this on develop, but since this PR touches that seed, can you cut it to 63 bits here? A test that reads a real input row with pandas would cover both seeds.
|
Done in 42e282b: the parachute noise seed is cut to 63 bits, and the test now runs a real study and reads its input file with |
Parachute no longer takes a public seed. StochasticParachute and from_dict set it through _set_noise_seed, which also redraws the first noise sample so the sequence is unchanged. to_dict still writes the seed, and from_dict still loads dicts without one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XDW575d9C9zpS7Z1v2KXVq
Each Monte Carlo input row records every parachute's noise seed, and it was 128 bits, so pandas.read_json failed with "Value is too big!", the same failure #1213 fixed for the study seed. The test now runs a real study and reads its input file with pandas, which covers both seeds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XDW574yAS8aQWohX238Bwc
StochasticParachute records the drawn dict plus the noise seed instead of writing the seed in and deleting it again. The first noise sample now reads the same bias and deviation as the rest of the chain. The test that rejects seed= checks the message, and a dead pylint disable goes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XDW574yAS8aQWohX238Bwc
The test keeps the pinned noise seeds and rebuilds the AR(1) chain from a fresh generator, so a NumPy release that changes its normal stream no longer fails it while the seeding code is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XDW574yAS8aQWohX238Bwc
With the public seed gone and numpy.random.seed no longer reaching the noise, the noise docstring now says it is reproducible only through the seed a Monte Carlo run records, or from_dict on a dict that carries one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XDW574yAS8aQWohX238Bwc
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XDW574yAS8aQWohX238Bwc
1bd0e1e to
9e724fc
Compare
Related to #1209
Parachuteno longer takes a publicseedargument, which was added after v1.13.0 and never released, so there is no deprecation.StochasticParachuteandParachute.from_dictnow set the pressure-noise seed through a private_set_noise_seedmethod, which also redraws the first noise sample from the seeded generator. The noise seed recorded in each Monte Carlo input row is cut to 63 bits sopandas.read_jsonreads it, as #1213 did for the study seed; this changes the noise a given study seed produces.to_dictstill writes the seed, andfrom_dictstill loads dicts without one, such as files written by v1.13.0.🤖 Generated with Claude Code
https://claude.ai/code/session_01XDW574yAS8aQWohX238Bwc