From f4437d3c2b285165140262d69e8430e853c29d7d Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Tue, 28 Nov 2023 01:31:15 -0300 Subject: [PATCH] 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()