Skip to content

Commit

Permalink
Ruth fixes for unsafe fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rcomer committed Nov 14, 2023
1 parent fc2d56b commit a3b11c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions cf_units/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ def title(self, value):
dt = self.num2date(value)
result = dt.strftime("%Y-%m-%d %H:%M:%S")
else:
result = f"{str(value)} {self}"
result = f"{value} {self}"
return result

@property
Expand Down Expand Up @@ -1792,9 +1792,8 @@ def convert(self, value, other, ctype=FLOAT64, inplace=False):
# Strict type check of numpy array.
if result.dtype.type not in (np.float32, np.float64):
raise TypeError(
"Expect a numpy array of '{}' or '{}'".format(*np.float32),
np.float64,
)
"Expect a numpy array of "
f"'{np.float32}' or '{np.float64}'")
ctype = result.dtype.type
# Utilise global convenience dictionary
# _cv_convert_array to convert our array in 1d form
Expand Down
2 changes: 1 addition & 1 deletion cf_units/tests/test_coding_standards.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def test_license_headers(self):
)

failed = False
for fname, _last_change in sorted(last_change_by_fname.items()):
for fname in sorted(last_change_by_fname):
full_fname = os.path.join(REPO_DIR, fname)
if (
full_fname.endswith(".py")
Expand Down

0 comments on commit a3b11c4

Please sign in to comment.