-
-
Notifications
You must be signed in to change notification settings - Fork 277
BUG: make a failing Monte Carlo worker say so #1182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
thc1006
wants to merge
10
commits into
RocketPy-Team:develop
Choose a base branch
from
thc1006:bug/report-a-worker-that-fails-before-its-first-simulation
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5a572d3
BUG: accept the seed type a Monte Carlo worker is handed
thc1006 204c6d6
BUG: report a worker that fails before its first simulation
thc1006 e32480f
BUG: notice a worker that never finished
thc1006 f25c61e
BUG: stop waiting on workers once one of them has died
thc1006 3a73caa
MNT: give the worker failure report a name of its own
thc1006 43428b4
BUG: judge a parallel run on its logs, not on how its workers ended
thc1006 7c3b03f
BUG: report the simulation that failed, and bring the fleet down whole
thc1006 eee7446
TST: read a log that an interrupted write left blank lines in
thc1006 141503a
BUG: keep the simulation index out of a data collector's reach
thc1006 629cd87
MNT: narrow what the failure path swallows, and log the change
thc1006 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import pytest | ||
|
|
||
| from rocketpy.simulation.monte_carlo import MonteCarlo | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("parallel", [False, True]) | ||
| def test_a_monte_carlo_run_finishes( | ||
| stochastic_environment, stochastic_calisto, stochastic_flight, tmp_path, parallel | ||
| ): | ||
| """A real run completes and records every simulation, both modes.""" | ||
| # The parallel path hands each worker a SeedSequence rather than an int, and | ||
| # nothing else in the suite exercises that. A worker that dies on it is not | ||
| # reported, so this reads as a hang rather than as a failure. | ||
| # | ||
| # Built here rather than taken from the monte_carlo_calisto fixture, whose | ||
| # own filename is fixed, since `filename` is a plain attribute and the three | ||
| # working paths are settled when the object is constructed. | ||
| analysis = MonteCarlo( | ||
| filename=str(tmp_path / "study"), | ||
| environment=stochastic_environment, | ||
| rocket=stochastic_calisto, | ||
| flight=stochastic_flight, | ||
| ) | ||
|
|
||
| analysis.simulate( | ||
| number_of_simulations=2, | ||
| append=False, | ||
| parallel=parallel, | ||
| n_workers=2 if parallel else None, | ||
| ) | ||
|
|
||
| assert analysis.num_of_loaded_sims == 2 | ||
| assert str(tmp_path) in str(analysis.output_file) |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.