Skip to content

Commit

Permalink
Use f-strings consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
mdpiper committed Aug 10, 2024
1 parent 88a6ffb commit 1e2253f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
16 changes: 4 additions & 12 deletions bmi_topography/bbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,12 @@ def __init__(self, lower_left: tuple[float], upper_right: tuple[float]) -> None:

if not isinstance(self.lower_left, Iterable) or len(self.lower_left) != 2:
raise ValueError(
"lower left coordinate ({}) must have two elements".format(
self.lower_left
)
f"lower left coordinate ({self.lower_left}) must have two elements"
)

if not isinstance(self.upper_right, Iterable) or len(self.upper_right) != 2:
raise ValueError(
"upper right coordinate ({}) must have two elements".format(
self.upper_right
)
f"upper right coordinate ({self.upper_right}) must have two elements"
)

if self.south > 90 or self.south < -90:
Expand All @@ -41,9 +37,7 @@ def __init__(self, lower_left: tuple[float], upper_right: tuple[float]) -> None:

if self.south > self.north:
raise ValueError(
"south coordinate ({}) must be less than north ({})".format(
self.south, self.north
)
f"south coordinate ({self.south}) must be less than north ({self.north})"
)

if self.west > 180 or self.west < -180:
Expand All @@ -54,9 +48,7 @@ def __init__(self, lower_left: tuple[float], upper_right: tuple[float]) -> None:

if self.west > self.east:
raise ValueError(
"west coordinate ({}) must be less than east ({})".format(
self.west, self.east
)
f"west coordinate ({self.west}) must be less than east ({self.east})"
)

@property
Expand Down
2 changes: 1 addition & 1 deletion bmi_topography/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def main(quiet, dem_type, south, north, west, east, output_format, api_key, no_f
path_to_dem = topo.fetch()
if not quiet:
click.secho(
"File downloaded to {}".format(getattr(topo, "cache_dir")),
f"File downloaded to {getattr(topo, "cache_dir")}",
fg="green",
err=True,
)
Expand Down

0 comments on commit 1e2253f

Please sign in to comment.