Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip mac sidecars #470

Merged
merged 11 commits into from
May 30, 2024
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/nwbinspector/nwbinspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 4 additions & 2 deletions tests/test_inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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)
Expand Down
Loading