From 7a4a6b9a0f7ea8e8d50b73bedb442fb4dfd2a759 Mon Sep 17 00:00:00 2001 From: Evan Madurai Date: Sat, 28 Dec 2024 21:12:27 +0000 Subject: [PATCH] ENH: cleaner calculation of result parameters --- rocketpy/simulation/monte_carlo.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rocketpy/simulation/monte_carlo.py b/rocketpy/simulation/monte_carlo.py index 7f6689599..16b47c64c 100644 --- a/rocketpy/simulation/monte_carlo.py +++ b/rocketpy/simulation/monte_carlo.py @@ -722,12 +722,17 @@ def set_processed_results(self): try: mean = np.mean(values) stdev = np.std(values) + self.processed_results[result] = (mean, stdev) pi_low = np.quantile(values, 0.025) pi_high = np.quantile(values, 0.975) median = np.median(values) - self.processed_results[result] = (mean, median, stdev, pi_low, pi_high) except TypeError: - self.processed_results[result] = (None, None, None, None, None) + mean = None + stdev = None + pi_low = None + pi_high = None + median = None + self.processed_results[result] = (mean, median, stdev, pi_low, pi_high) # Import methods