Skip to content

Commit

Permalink
add nave to save/load roundtrip
Browse files Browse the repository at this point in the history
  • Loading branch information
drammock committed Jan 3, 2024
1 parent e1c5962 commit 8846e81
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mne/time_frequency/spectrogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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"]]
Expand Down Expand Up @@ -1222,6 +1226,7 @@ def __init__(
**method_kw,
)

# TODO are there other properties of `inst` we should propagate here?
self._nave = inst.nave

@property
Expand Down

0 comments on commit 8846e81

Please sign in to comment.