diff --git a/src/nwbinspector/nwbinspector.py b/src/nwbinspector/nwbinspector.py index 6940e72b0..e8b9bf95f 100644 --- a/src/nwbinspector/nwbinspector.py +++ b/src/nwbinspector/nwbinspector.py @@ -623,7 +623,7 @@ def _intercept_in_vitro(nwbfile_object: pynwb.NWBFile, checks: Optional[list] = if ( any(subject_related_dandi_requirements) and subject is not None - and getattr(subject, "subject_id", "") == "in_vitro" + and getattr(subject, "subject_id", "").startswith("in_vitro_") ): non_subject_checks = [check for check in checks if check.__name__ not in subject_related_check_names] return non_subject_checks diff --git a/tests/test_inspector.py b/tests/test_inspector.py index 385f77413..b44aaa8c5 100644 --- a/tests/test_inspector.py +++ b/tests/test_inspector.py @@ -6,10 +6,10 @@ from datetime import datetime import numpy as np -import pynwb from pynwb import NWBFile, NWBHDF5IO, TimeSeries -from pynwb.file import TimeIntervals +from pynwb.file import TimeIntervals, Subject from pynwb.behavior import SpatialSeries, Position +from pynwb.testing.mock.file import mock_NWBFile from hdmf.common import DynamicTable from natsort import natsorted @@ -731,10 +731,8 @@ def test_check_unique_identifiers_fail(self): def test_dandi_config_in_vitro_injection(): """Test that a special subject_id of 'in_vitro' properly excludes meaningless CRITICAL-elevated subject checks.""" - nwbfile = pynwb.testing.mock.file.mock_NWBFile( - subject=pynwb.file.Subject( - subject_id="in_vitro", description="A detailed description about the in vitro setup." - ) + nwbfile = mock_NWBFile( + subject=Subject(subject_id="in_vitro_CaMPARI3", description="A detailed description about the in vitro setup.") ) config = load_config(filepath_or_keyword="dandi") importance_threshold = "CRITICAL"