8000 BUG: fix the wind velocity factors usage and better visualization of uniform distributions in Stochastic Classes by kevin-alcaniz · Pull Request #783 · RocketPy-Team/RocketPy · GitHub
[go: up one dir, main page]

Skip to content

BUG: fix the wind velocity factors usage and better visualization of uniform distributions in Stochastic Classes #783

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

Merged
merged 8 commits into from
Mar 23, 2025
Prev Previous commit
Next Next commit
ENH: more intuitive uniform distribution display in StochasticModel
Co-authored-by: MateusStano <69485049+MateusStano@users.noreply.github.com>
  • Loading branch information
kevin-alcaniz and MateusStano authored Mar 22, 2025
commit 7c68241adf11fe0d8b08b8047eb3c9f511dd242d
A57A 7 changes: 3 additions & 4 deletions rocketpy/stochastic/stochastic_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,12 +515,11 @@
elif isinstance(value, tuple):
nominal_value, std_dev, dist_func = value
if callable(dist_func) and dist_func.__name__ == "uniform":
mean = (std_dev + nominal_value) / 2
half_range = (std_dev - nominal_value) / 2
lower_bound = nominal_value
upper_bound = std_dev
return (

Check warning on line 520 in rocketpy/stochastic/stochastic_model.py

View check run for this annotation

Codecov / codecov/patch

rocketpy/stochastic/stochastic_model.py#L518-L520

Added lines #L518 - L520 were not covered by tests
f"\t{attr.ljust(max_str_length)} "
f"{mean:.5f} ± "
f"{half_range:.5f} ({dist_func.__name__})"
f"{lower_bound:.5f}, {upper_bound:.5f} ({dist_func.__name__})"
)
else:
return (
Expand Down
0