From 396b1227bcbdef13be41e6c7134625a275d0b4a3 Mon Sep 17 00:00:00 2001 From: William Armstrong Date: Mon, 2 Dec 2024 11:32:32 -0700 Subject: [PATCH 1/3] BUG: Correctly update atmospheric conditions after changing date and location add location --- CHANGELOG.md | 2 ++ rocketpy/environment/environment.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bfd5501ae..42dbd3b1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,8 @@ Attention: The newest changes should be on top --> ### Fixed +- BUG: Correctly update atmospheric conditions after changing date and location [#743](https://github.com/RocketPy-Team/RocketPy/pull/743) + ## [v1.7.0] - 2024-11-30 diff --git a/rocketpy/environment/environment.py b/rocketpy/environment/environment.py index 394275763..498b758f8 100644 --- a/rocketpy/environment/environment.py +++ b/rocketpy/environment/environment.py @@ -688,7 +688,7 @@ def set_date(self, date, timezone="UTC"): "Ensemble", ]: self.set_atmospheric_model( - self.atmospheric_model_file, self.atmospheric_model_dict + self.atmospheric_model_type, self.atmospheric_model_file, self.atmospheric_model_dict ) def set_location(self, latitude, longitude): @@ -726,7 +726,7 @@ def set_location(self, latitude, longitude): "Ensemble", ]: self.set_atmospheric_model( - self.atmospheric_model_file, self.atmospheric_model_dict + self.atmospheric_model_type, self.atmospheric_model_file, self.atmospheric_model_dict ) def set_gravity_model(self, gravity=None): From cb25bad85ce533d46908a76d882fbdcb191e3f41 Mon Sep 17 00:00:00 2001 From: William Armstrong Date: Mon, 2 Dec 2024 11:59:38 -0700 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> --- rocketpy/environment/environment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rocketpy/environment/environment.py b/rocketpy/environment/environment.py index 498b758f8..7a215b022 100644 --- a/rocketpy/environment/environment.py +++ b/rocketpy/environment/environment.py @@ -688,7 +688,7 @@ def set_date(self, date, timezone="UTC"): "Ensemble", ]: self.set_atmospheric_model( - self.atmospheric_model_type, self.atmospheric_model_file, self.atmospheric_model_dict + type=self.atmospheric_model_type, file=self.atmospheric_model_file, dictionary=self.atmospheric_model_dict ) def set_location(self, latitude, longitude): @@ -726,7 +726,7 @@ def set_location(self, latitude, longitude): "Ensemble", ]: self.set_atmospheric_model( - self.atmospheric_model_type, self.atmospheric_model_file, self.atmospheric_model_dict + type=self.atmospheric_model_type, file=self.atmospheric_model_file, dictionary=self.atmospheric_model_dict ) def set_gravity_model(self, gravity=None): From cf98bb34ccc4c51636352f9813772fbd23f632b4 Mon Sep 17 00:00:00 2001 From: William Armstrong Date: Tue, 3 Dec 2024 10:37:49 -0700 Subject: [PATCH 3/3] fix date and location atmosphere update formatting --- rocketpy/environment/environment.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rocketpy/environment/environment.py b/rocketpy/environment/environment.py index 7a215b022..dbabeee78 100644 --- a/rocketpy/environment/environment.py +++ b/rocketpy/environment/environment.py @@ -688,7 +688,9 @@ def set_date(self, date, timezone="UTC"): "Ensemble", ]: self.set_atmospheric_model( - type=self.atmospheric_model_type, file=self.atmospheric_model_file, dictionary=self.atmospheric_model_dict + type=self.atmospheric_model_type, + file=self.atmospheric_model_file, + dictionary=self.atmospheric_model_dict, ) def set_location(self, latitude, longitude): @@ -726,7 +728,9 @@ def set_location(self, latitude, longitude): "Ensemble", ]: self.set_atmospheric_model( - type=self.atmospheric_model_type, file=self.atmospheric_model_file, dictionary=self.atmospheric_model_dict + type=self.atmospheric_model_type, + file=self.atmospheric_model_file, + dictionary=self.atmospheric_model_dict, ) def set_gravity_model(self, gravity=None):