Skip to content

Commit

Permalink
Use f-strings instead of format method
Browse files Browse the repository at this point in the history
  • Loading branch information
mdpiper committed Aug 16, 2024
1 parent 6c1a683 commit a5ba932
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bmi_geotiff/bmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def get_value(self, name: str, dest: numpy.ndarray) -> numpy.ndarray:
elif name == self._output_var_names[2]:
dest[:] = self._da.rio.transform()
else:
raise ValueError("get_value not available for {}.".format(name))
raise ValueError(f"get_value not available for {name}.")

return dest

Expand All @@ -509,7 +509,7 @@ def get_value_at_indices(
dest[:] = self.get_value_ptr(name).reshape(-1)[inds]
return dest
else:
raise ValueError("get_value_at_indices not available for {}.".format(name))
raise ValueError(f"get_value_at_indices not available for {name}.")

def get_value_ptr(self, name: str) -> numpy.ndarray:
"""Get a reference to values of the given variable.
Expand All @@ -531,7 +531,7 @@ def get_value_ptr(self, name: str) -> numpy.ndarray:
if name == self._output_var_names[0]:
return self._da.values
else:
raise ValueError("get_value_ptr not available for {}.".format(name))
raise ValueError(f"get_value_ptr not available for {name}.")

def get_var_grid(self, name: str) -> int:
"""Get grid identifier for the given variable.
Expand Down

0 comments on commit a5ba932

Please sign in to comment.