From f4437d3c2b285165140262d69e8430e853c29d7d Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Tue, 28 Nov 2023 01:31:15 -0300 Subject: [PATCH 1/3] MNT: Add __repr__ method to Parachute class --- rocketpy/rocket/parachute.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rocketpy/rocket/parachute.py b/rocketpy/rocket/parachute.py index 0bfd9f9b9..8e3c06757 100644 --- a/rocketpy/rocket/parachute.py +++ b/rocketpy/rocket/parachute.py @@ -220,6 +220,13 @@ def __str__(self): self.cd_s, ) + def __repr__(self): + """Representation method for the class, useful when debugging.""" + return ( + f"'{self.name}' parachute " + + f"(cd_s = {self.cd_s:.4f} m2, trigger = {self.trigger})" + ) + def info(self): """Prints information about the Parachute class.""" self.prints.all() From daa2dd66261df0db7cf4f649143a6e4fb84d0be9 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Thu, 30 Nov 2023 02:27:49 -0300 Subject: [PATCH 2/3] MNT: Update parachute __repr__ method 2 convention --- rocketpy/rocket/parachute.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rocketpy/rocket/parachute.py b/rocketpy/rocket/parachute.py index 8e3c06757..efc274985 100644 --- a/rocketpy/rocket/parachute.py +++ b/rocketpy/rocket/parachute.py @@ -223,8 +223,8 @@ def __str__(self): def __repr__(self): """Representation method for the class, useful when debugging.""" return ( - f"'{self.name}' parachute " - + f"(cd_s = {self.cd_s:.4f} m2, trigger = {self.trigger})" + f"" ) def info(self): From 72ca940be1f7107c7fbcfaa82a589855adda4039 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Thu, 30 Nov 2023 02:29:23 -0300 Subject: [PATCH 3/3] MNT: Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bcb06322..63109ce65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,7 +36,7 @@ straightforward as possible. ### Changed -- +- MNT: Add repr method to Parachute class [#490](https://github.com/RocketPy-Team/RocketPy/pull/490) ### Fixed