Skip to content

MNT: make the parachute noise seed private - #1227

Merged
MateusStano merged 6 commits into
developfrom
mnt/private-parachute-seed
Nov 23, 2026
Merged

MateusStano merged 6 commits into
developfrom
mnt/private-parachute-seed

Conversation

@Gui-FernandesBR

@Gui-FernandesBR Gui-FernandesBR commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Related to #1209

Parachute no longer takes a public seed argument, which was added after v1.13.0 and never released, so there is no deprecation. StochasticParachute and Parachute.from_dict now set the pressure-noise seed through a private _set_noise_seed method, 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 so pandas.read_json reads it, as #1213 did for the study seed; this changes the noise a given study seed produces. to_dict still writes the seed, and from_dict still loads dicts without one, such as files written by v1.13.0.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XDW574yAS8aQWohX238Bwc

@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.67%. Comparing base (6b2a37f) to head (9e724fc).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Gui-FernandesBR Gui-FernandesBR mentioned this pull request Nov 20, 2026
7 of 11 tasks

@MateusStano MateusStano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Gui-FernandesBR

Copy link
Copy Markdown
Member Author

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 pandas.read_json, which covers both seeds (it fails with "Value is too big!" without the fix).

Gui-FernandesBR and others added 6 commits November 21, 2026 10:25
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
@Gui-FernandesBR
Gui-FernandesBR force-pushed the mnt/private-parachute-seed branch from 1bd0e1e to 9e724fc Compare November 21, 2026 13:33
@MateusStano
MateusStano merged commit b389b43 into develop Nov 23, 2026
9 checks passed
@MateusStano
MateusStano deleted the mnt/private-parachute-seed branch November 23, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants