diff --git a/mne/time_frequency/spectrogram.py b/mne/time_frequency/spectrogram.py index 9e5700ca63e..844ab50b411 100644 --- a/mne/time_frequency/spectrogram.py +++ b/mne/time_frequency/spectrogram.py @@ -186,6 +186,8 @@ def __getstate__(self): data_type=self._data_type, info=self.info, ) + if hasattr(self, "nave"): + out.update(nave=self.nave) return out def __setstate__(self, state): @@ -202,6 +204,8 @@ def __setstate__(self, state): self.info = Info(**state["info"]) self._data_type = state["data_type"] self.preload = True + if "nave" in state: + self._nave = state["nave"] # instance type inst_types = dict(Raw=Raw, Epochs=Epochs, Evoked=Evoked) self._inst_type = inst_types[state["inst_type_str"]] @@ -1222,6 +1226,7 @@ def __init__( **method_kw, ) + # TODO are there other properties of `inst` we should propagate here? self._nave = inst.nave @property