Skip to content

Commit

Permalink
MNT: Add __repr__ method to Parachute class
Browse files Browse the repository at this point in the history
  • Loading branch information
Gui-FernandesBR committed Nov 28, 2023
1 parent c1e43ec commit f4437d3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rocketpy/rocket/parachute.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ def __str__(self):
self.cd_s,
)

def __repr__(self):
"""Representation method for the class, useful when debugging."""
return (

Check warning on line 225 in rocketpy/rocket/parachute.py

View check run for this annotation

Codecov / codecov/patch

rocketpy/rocket/parachute.py#L225

Added line #L225 was not covered by tests
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()
Expand Down

0 comments on commit f4437d3

Please sign in to comment.