-
Notifications
You must be signed in to change notification settings - Fork 0
Fix steam_length → stem_length typo in DigRivers
#84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -181,8 +181,8 @@ class DigRivers(SimpleAction): | |||||
| """ | ||||||
|
|
||||||
| @staticmethod | ||||||
| def _steam_length_to_stem( | ||||||
| steam_length: int, side: Literal["N", "S", "E", "W"] | ||||||
| def _stem_length_to_stem( | ||||||
| stem_length: int, side: Literal["N", "S", "E", "W"] | ||||||
| ) -> List[Movement]: | ||||||
| """ | ||||||
| Converts the "stem_length" parameter into a list of `Movement` objects. | ||||||
|
|
@@ -194,7 +194,7 @@ def _steam_length_to_stem( | |||||
| its defined side. | ||||||
|
|
||||||
| Args: | ||||||
| steam_length: The length of the river's stem measured in grid | ||||||
| stem_length: The length of the river's stem measured in grid | ||||||
| cells. | ||||||
| side: The side of the grid (North, South, East, or West) | ||||||
| representing the river's origin. | ||||||
|
|
@@ -204,22 +204,22 @@ def _steam_length_to_stem( | |||||
| direction and length. | ||||||
|
|
||||||
| Raises: | ||||||
| ValueError: If the provided side is invalid or `steam_length` is not | ||||||
| ValueError: If the provided side is invalid or `stem_length` is not | ||||||
| a positive integer. | ||||||
| """ | ||||||
| if side not in ("N", "S", "E", "W"): | ||||||
| raise ValueError(f"Invalid side: {side}") | ||||||
| if steam_length <= 0: | ||||||
| if stem_length <= 0: | ||||||
| raise ValueError( | ||||||
| "Steam length must be a positive number of cell: received " | ||||||
| f"{steam_length}" | ||||||
| "Stem length must be a positive number of cell: received " | ||||||
| f"{stem_length}" | ||||||
| ) | ||||||
| river_side = Direction(side) | ||||||
|
||||||
| river_side = Direction(side) | |
| river_side = -Direction(side) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message has a grammatical typo: "positive number of cell" should be "positive number of cells" (and possibly "cells:" vs "cells;" depending on style). This string is user-facing, so it’s worth correcting while touching it.