From ca7ddad9907dbd6fbb43563ece6090ebaee10c4e Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 9 Sep 2024 17:35:10 -0400 Subject: [PATCH] Use "cache_spec:False" in our copy_nwb_file helper while exporting NWB copy Stopped since ideally we should make it dependent on either original file contains the spec --- dandi/pynwb_utils.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dandi/pynwb_utils.py b/dandi/pynwb_utils.py index 3d0a8b3ec..a8dca3e31 100644 --- a/dandi/pynwb_utils.py +++ b/dandi/pynwb_utils.py @@ -518,7 +518,16 @@ def copy_nwb_file(src: str | Path, dest: str | Path) -> str: with pynwb.NWBHDF5IO(src, "r") as ior, pynwb.NWBHDF5IO(dest, "w") as iow: data = ior.read() data.generate_new_id() - iow.export(ior, nwbfile=data) + iow.export( + ior, + nwbfile=data, + # do not export spec since + **( + {"cache_spec": False} + if Version(pynwb.__version__) > Version("2.8.2.dev11") + else {} + ), + ) return str(dest)