Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ straightforward as possible.

### Changed

- MNT: Add repr method to Parachute class [#490](https://github.com/RocketPy-Team/RocketPy/pull/490)
- ENH: Function Reverse Arithmetic Priority [#488](https://github.com/RocketPy-Team/RocketPy/pull/488)

### Fixed
Expand Down
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 (
f"<Parachute {self.name} "
+ 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