Skip to content

Commit 9f242ff

Browse files
skip mac sidecars (#470)
* skip mac sidecars * moved skip to right after glob * added test for ._ nwb file * updated changelog * trigger pre-commit * trigger pre-commit * trigger pre-commit * reformat line break * added non-matching timestamps to sidecar file * changed ._ file to last one in the list --------- Co-authored-by: Cody Baker <[email protected]>
1 parent 4fa24bf commit 9f242ff

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
* Fixed the suggested rate in `check_regular_timestamps` to be in Hz [#467](https://github.com/NeurodataWithoutBorders/nwbinspector/pull/467)
66

7+
* Added a skip for mac sidecar files (._*): [#470](https://github.com/NeurodataWithoutBorders/nwbinspector/pull/470)
8+
79
# v0.4.35
810

911
### Fixes

src/nwbinspector/nwbinspector.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,9 @@ def inspect_all(
395395
in_path = Path(path)
396396
if in_path.is_dir():
397397
nwbfiles = list(in_path.rglob("*.nwb"))
398+
399+
# Remove any macOS sidecar files
400+
nwbfiles = [nwbfile for nwbfile in nwbfiles if not nwbfile.name.startswith("._")]
398401
elif in_path.is_file():
399402
nwbfiles = [in_path]
400403
else:

tests/test_inspector.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def setUpClass(cls):
9090
check_data_orientation,
9191
check_timestamps_match_first_dimension,
9292
]
93-
num_nwbfiles = 3
93+
num_nwbfiles = 4
9494
nwbfiles = list()
9595
for j in range(num_nwbfiles):
9696
nwbfiles.append(make_minimal_nwbfile())
@@ -100,9 +100,11 @@ def setUpClass(cls):
100100
add_non_matching_timestamps_dimension(nwbfiles[0])
101101
add_simple_table(nwbfiles[0])
102102
add_regular_timestamps(nwbfiles[1])
103-
# Last file to be left without violations
103+
# Third file to be left without violations
104+
add_non_matching_timestamps_dimension(nwbfiles[3])
104105

105106
cls.nwbfile_paths = [str(cls.tempdir / f"testing{j}.nwb") for j in range(num_nwbfiles)]
107+
cls.nwbfile_paths[3] = str(cls.tempdir / f"._testing3.nwb")
106108
for nwbfile_path, nwbfile in zip(cls.nwbfile_paths, nwbfiles):
107109
with NWBHDF5IO(path=nwbfile_path, mode="w") as io:
108110
io.write(nwbfile)

0 commit comments

Comments
 (0)