Skip to content

Commit

Permalink
Merge pull request #490 from RocketPy-Team/mnt/parachute-repr-method
Browse files Browse the repository at this point in the history
MNT: Add __repr__ method to Parachute class
  • Loading branch information
Gui-FernandesBR authored Nov 30, 2023
2 parents ae45abe + 8def7ad commit a9ac31c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
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 (

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"<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

0 comments on commit a9ac31c

Please sign in to comment.