Skip to content

Commit

Permalink
switch a couple errors to f-strings
Browse files Browse the repository at this point in the history
  • Loading branch information
zm711 committed Oct 13, 2023
1 parent 48ddbf4 commit 0279e44
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions neo/core/baseneo.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ def _check_annotations(value):
"""
if isinstance(value, np.ndarray):
if not issubclass(value.dtype.type, ALLOWED_ANNOTATION_TYPES):
raise ValueError("Invalid annotation. NumPy arrays with dtype %s"
"are not allowed" % value.dtype.type)
raise ValueError(f"Invalid annotation. NumPy arrays with dtype {value.dtype.type}"
"are not allowed")
elif isinstance(value, dict):
for element in value.values():
_check_annotations(element)
elif isinstance(value, (list, tuple)):
for element in value:
_check_annotations(element)
elif not isinstance(value, ALLOWED_ANNOTATION_TYPES):
raise ValueError("Invalid annotation. Annotations of type %s are not"
"allowed" % type(value))
raise ValueError(f"Invalid annotation. Annotations of type {type(value)} are not"
"allowed")


def merge_annotation(a, b):
Expand Down

0 comments on commit 0279e44

Please sign in to comment.