diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bcd996f3..33311b094 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ * Fixed the suggested rate in `check_regular_timestamps` to be in Hz [#467](https://github.com/NeurodataWithoutBorders/nwbinspector/pull/467) +* Added a skip for mac sidecar files (._*): [#470](https://github.com/NeurodataWithoutBorders/nwbinspector/pull/470) + # v0.4.35 ### Fixes diff --git a/src/nwbinspector/nwbinspector.py b/src/nwbinspector/nwbinspector.py index 994ac30df..8f6f89e7c 100644 --- a/src/nwbinspector/nwbinspector.py +++ b/src/nwbinspector/nwbinspector.py @@ -395,6 +395,9 @@ def inspect_all( in_path = Path(path) if in_path.is_dir(): nwbfiles = list(in_path.rglob("*.nwb")) + + # Remove any macOS sidecar files + nwbfiles = [nwbfile for nwbfile in nwbfiles if not nwbfile.name.startswith("._")] elif in_path.is_file(): nwbfiles = [in_path] else: diff --git a/tests/test_inspector.py b/tests/test_inspector.py index 8fd4808f8..235a5dfcc 100644 --- a/tests/test_inspector.py +++ b/tests/test_inspector.py @@ -90,7 +90,7 @@ def setUpClass(cls): check_data_orientation, check_timestamps_match_first_dimension, ] - num_nwbfiles = 3 + num_nwbfiles = 4 nwbfiles = list() for j in range(num_nwbfiles): nwbfiles.append(make_minimal_nwbfile()) @@ -100,9 +100,11 @@ def setUpClass(cls): add_non_matching_timestamps_dimension(nwbfiles[0]) add_simple_table(nwbfiles[0]) add_regular_timestamps(nwbfiles[1]) - # Last file to be left without violations + # Third file to be left without violations + add_non_matching_timestamps_dimension(nwbfiles[3]) cls.nwbfile_paths = [str(cls.tempdir / f"testing{j}.nwb") for j in range(num_nwbfiles)] + cls.nwbfile_paths[3] = str(cls.tempdir / f"._testing3.nwb") for nwbfile_path, nwbfile in zip(cls.nwbfile_paths, nwbfiles): with NWBHDF5IO(path=nwbfile_path, mode="w") as io: io.write(nwbfile)