Skip to content

Commit 8c9d00d

Browse files
authored
Merge pull request #542 from AllenInstitute/fix-nwb-files-failing-dandi-validate
Stop IPFX from caching its NWB Schemas when writing/modifying NWB files
2 parents 905ee74 + ec006b7 commit 8c9d00d

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
command: |
3737
python3 -m venv venv
3838
. venv/bin/activate
39+
pip install -U pip
3940
pip install -U -r requirements.txt
4041
pip install codecov
4142

ipfx/attach_metadata/sink/nwb2_sink.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,11 @@ def _commit_nwb_changes(self):
9494

9595
set_container_sources(self.nwbfile, self._h5_file.filename)
9696
self.nwbfile.set_modified(True)
97-
self._nwb_io.write(self.nwbfile)
97+
# Because the NWB schema versions of NWB data produced by MIES are older
98+
# we do not want to cache the newer schema versions that IPFX is currently using
99+
# WARNING: Doing this may introduce fragility down the road though if IPFX writes NWB fields
100+
# that require the newer schema versions...
101+
self._nwb_io.write(self.nwbfile, cache_spec=False)
98102
self._nwb_io.close()
99103
self._h5_file.close()
100104

ipfx/nwb_append.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ def append_spike_times(input_nwb_path: PathLike,
6363

6464
nwbfile.add_processing_module(spike_module)
6565

66-
nwb_io.write(nwbfile)
66+
# Because the NWB schema versions of NWB data produced by MIES are older
67+
# we do not want to cache the newer schema versions that IPFX is currently using
68+
# WARNING: Doing this may introduce fragility down the road though if IPFX writes NWB fields
69+
# that require the newer schema versions...
70+
nwb_io.write(nwbfile, cache_spec=False)
6771
else:
6872
raise ValueError("Cannot add spikes times to the nwb file: "
6973
"spikes times already exist!")

ipfx/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.5
1+
1.0.6

0 commit comments

Comments
 (0)