Skip to content

Commit 9b94659

Browse files
committed
make subject species error message include current species name
1 parent d20ec8d commit 9b94659

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

nwbinspector/checks/nwbfile_metadata.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ def check_subject_species_latin_binomial(subject: Subject):
130130
"""Check if the subject species follows latin binomial form."""
131131
if subject.species and not re.fullmatch(species_regex, subject.species):
132132
return InspectorMessage(
133-
message="Species should be in latin binomial form, e.g. 'Mus musculus' and 'Homo sapiens'",
133+
message=f"Subject species '{subject.species}' should be in latin binomial form, e.g. 'Mus musculus' and "
134+
f"'Homo sapiens'",
134135
)
135136

136137

tests/unit_tests/test_nwbfile_metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def test_check_subject_species_not_binomial():
278278
subject = Subject(subject_id="001", species="Human")
279279

280280
assert check_subject_species_latin_binomial(subject) == InspectorMessage(
281-
message="Species should be in latin binomial form, e.g. 'Mus musculus' and 'Homo sapiens'",
281+
message="Subject species 'Human' should be in latin binomial form, e.g. 'Mus musculus' and 'Homo sapiens'",
282282
importance=Importance.BEST_PRACTICE_VIOLATION,
283283
check_function_name="check_subject_species_latin_binomial",
284284
object_type="Subject",

0 commit comments

Comments
 (0)