[TypeError: subject_info["birthday"] must be an instance of date or None, got <class 'tuple'> instead.

:red_question_mark: If you have a question or issue with MNE-Python, please include the following info:

  • MNE version: 1.10.0
  • operating system: e.g. macOS Sequoia 15.7.2.

:page_facing_up: Please also provide relevant code snippets – ideally a minimal working example (MWE).

After succesfully producing power and itc using the “compute_tfr” function as follows:

epos = mne.read_epochs(epo_in, preload=True)
epos.pick(picks)
epos.drop_bad(reject = reject_epo)
epos = mne.epochs.combine_event_ids(epos,
[‘ref/-8_proj’,
‘ref/-4_proj’,
‘ref/4_proj’,
‘ref/8_proj’],
{‘ref/comb_proj’: 60})

epos.equalize_event_counts(conds)

_ , itc  = epos[c].compute_tfr(method = “morlet”, freqs=freqs, n_cycles=n_cycles,
return_itc=True, average = True)

reading the profuced tfr file

tfrs = mne.time_frequency.read_tfrs(fname_in)


returns the following error:

Reading //Volumes/neurospin/meg/meg_tmp/2023_egoMEG_Wagelmans/MEG/tfr/ag230213_egoMEG_itc_combpresent-tfr.h5 …

TypeError                                 Traceback (most recent call last)
File /Volumes/meg_tmp/2023_egoMEG_Wagelmans/SCRIPTS/tfr_ref_pipeline/008_TFR_iplot.py:65
61 fname_in = f’{tfr_dir}{subject}egoMEG{meas}_{c_names[0]}-tfr.h5’
64 # %%
—> 65 tfrs = mne.time_frequency.read_tfrs(fname_in)
70 #___plot power
71 # %%
72 tfrs[“ref/0_proj”].plot(picks=[“MEG2431”],
73                 baseline = (-0.8, 0),
74                 tmin = -0.5,
(…)
79                 mode = “logratio”
80                 )

File :12, in read_tfrs(fname, condition, verbose)

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:4119, in read_tfrs(fname, condition, verbose)
4117 else:
4118     Klass = RawTFR
→ 4119 out = Klass(inst=hdf5_dict)
4120 if getattr(out, “metadata”, None) is not None:
4121     out.metadata = _prepare_read_metadata(out.metadata)

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:2911, in AverageTFR.init(self, inst, freqs, method, tmin, tmax, picks, proj, decim, comment, n_jobs, verbose, **method_kw)
2909 else:
2910     self._comment = getattr(self, “_comment”, comment)
→ 2911 super().init(
2912     inst,
2913     method,
2914     freqs,
2915     tmin=tmin,
2916     tmax=tmax,
2917     picks=picks,
2918     proj=proj,
2919     decim=decim,
2920     n_jobs=n_jobs,
2921     verbose=verbose,
2922     **method_kw,
2923 )

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:1194, in BaseTFR.init(self, inst, method, freqs, tmin, tmax, picks, proj, decim, n_jobs, reject_by_annotation, verbose, **method_kw)
1192 # triage reading from file
1193 if isinstance(inst, dict):
→ 1194     self.setstate(inst)
1195     return
1196 if method is None or freqs is None:

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:2950, in AverageTFR.setstate(self, state)
2948     state[“dims”] += (“taper”,)
2949 state[“dims”] += (“freq”, “time”)
→ 2950 super().setstate(state)
2951 self._comment = state.get(“comment”, “”)
2952 self._nave = state.get(“nave”, 1)

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:1436, in BaseTFR.setstate(self, state)
1434 self._raw_times = np.asarray(defaults[“times”], dtype=np.float64)
1435 self._baseline = defaults[“baseline”]
→ 1436 self.info = Info(**defaults[“info”])
1437 self._data_type = defaults[“data_type”]
1438 self._decim = defaults[“decim”]

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:1698, in Info.init(self, *args, **kwargs)
1696 for key in (“helium_info”, “subject_info”):
1697     if key in self:
→ 1698         self[key] = self[key]

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:960, in ValidatedDict.setitem(self, key, val)
958             raise RuntimeError(self._attributes[key])
959     else:
→ 960         val = self._attributes[key](
961             val, info=self
962         )  # attribute checker function
963 else:
964     class_name = self.class.name

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:1010, in _check_types(x, info, name, types, cast)
1008 _validate_type(x, types, name)
1009 if cast is not None and x is not None:
→ 1010     x = cast(x)
1011 return x

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:1053, in SubjectInfo.init(self, initial)
1051 super().init()
1052 for key, val in initial.items():
→ 1053     self[key] = val

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:960, in ValidatedDict.setitem(self, key, val)
958             raise RuntimeError(self._attributes[key])
959     else:
→ 960         val = self._attributes[key](
961             val, info=self
962         )  # attribute checker function
963 else:
964     class_name = self.class.name

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:1015, in _check_bday(birthday_input, info)
1014 def _check_bday(birthday_input, *, info):
→ 1015     date = _check_types(
1016         birthday_input,
1017         info=info,
1018         name=‘subject_info[“birthday”]’,
1019         types=(datetime.date, None),
1020     )
1021     # test if we have a pd.Timestamp
1022     if hasattr(date, “date”):

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:1008, in _check_types(x, info, name, types, cast)
1007 def _check_types(x, *, info, name, types, cast=None):
→ 1008     _validate_type(x, types, name)
1009     if cast is not None and x is not None:
1010         x = cast(x)

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/utils/check.py:645, in _validate_type(item, types, item_name, type_name, extra)
643 _item_name = “Item” if item_name is None else item_name
644 _item_type = type(item) if item is not None else item
→ 645 raise TypeError(
646     f"{_item_name} must be an instance of {type_name}{extra}, "
647     f"got {_item_type} instead."
648 )

TypeError: subject_info[“birthday”] must be an instance of date or None, got <class ‘tuple’> instead.

@sophie pointed. to this report Trouble with measurement dates when anonymizing or writing epochs data · Issue #13154 · mne-tools/mne-python · GitHub but it doesn’t seem to be identical.

Any pointer much appreciated

Hello,

The format of birthday was changed from a tuple to a date object in MNE 1.8. Was the AverageTFR ITC file you’re trying to load saved with an old version of MNE (<1.8)?

I am not able to reproduce this with an object saved on 1.10, but that could be due to something in your itc.info or how you are saving the AverageTFR object. Please can you provide more info about this if the above point about saving on an old MNE version isn’t the case.

Cheers,
Thomas

1 Like

Hello Thomas, thank you for your fast and helpful feedback on the matter.

I just computed a tfr file de novo. Unfortunately, the error is identical whether the tfr is computed with an outdated version (1.7) or the current version (1.10.1) of mne-python.


Reading //Volumes/.../ipow_combpresent-tfr.h5 …

TypeError                                 Traceback (most recent call last)
File /Volumes/meg_tmp/2023_egoMEG_Wagelmans/SCRIPTS/tfr_ref_pipeline/008_TFR_iplot.py:65
61 fname_in = f’{tfr_dir}{subject}egoMEG{meas}_{c_names[0]}-tfr.h5’
64 #%% load data
—> 65 tfrs = mne.time_frequency.read_tfrs(fname_in)
67 #error subject_info[“birthday”] must be an instance of date or None, got <class ‘tuple’> instead.
68
69 #%% plot data
70 tfrs[“ref/0_proj”].plot(picks=[“MEG2431”],
71                 baseline = (-0.8, 0),
72                 tmin = -0.5,
(…)
77                 mode = “logratio”
78                 )

File :12, in read_tfrs(fname, condition, verbose)

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:4119, in read_tfrs(fname, condition, verbose)
4117 else:
4118     Klass = RawTFR
 → 4119 out = Klass(inst=hdf5_dict)
4120 if getattr(out, “metadata”, None) is not None:
4121     out.metadata = _prepare_read_metadata(out.metadata)

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:2911, in AverageTFR.init(self, inst, freqs, method, tmin, tmax, picks, proj, decim, comment, n_jobs, verbose, **method_kw)
2909 else:
2910     self._comment = getattr(self, “_comment”, comment)
 → 2911 super().init(
2912     inst,
2913     method,
2914     freqs,
2915     tmin=tmin,
2916     tmax=tmax,
2917     picks=picks,
2918     proj=proj,
2919     decim=decim,
2920     n_jobs=n_jobs,
2921     verbose=verbose,
2922     **method_kw,
2923 )

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:1194, in BaseTFR.init(self, inst, method, freqs, tmin, tmax, picks, proj, decim, n_jobs, reject_by_annotation, verbose, **method_kw)
1192 # triage reading from file
1193 if isinstance(inst, dict):
 → 1194     self.setstate(inst)
1195     return
1196 if method is None or freqs is None:

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:2950, in AverageTFR.setstate(self, state)
2948     state[“dims”] += (“taper”,)
2949 state[“dims”] += (“freq”, “time”)
 → 2950 super().setstate(state)
2951 self._comment = state.get(“comment”, “”)
2952 self._nave = state.get(“nave”, 1)

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:1436, in BaseTFR.setstate(self, state)
1434 self._raw_times = np.asarray(defaults[“times”], dtype=np.float64)
1435 self._baseline = defaults[“baseline”]
 → 1436 self.info = Info(**defaults[“info”])
1437 self._data_type = defaults[“data_type”]
1438 self._decim = defaults[“decim”]

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:1698, in Info.init(self, *args, **kwargs)
1696 for key in (“helium_info”, “subject_info”):
1697     if key in self:
 → 1698         self[key] = self[key]

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:960, in ValidatedDict.setitem(self, key, val)
958             raise RuntimeError(self._attributes[key])
959     else:
 → 960         val = self._attributes[key](
961             val, info=self
962         )  # attribute checker function
963 else:
964     class_name = self.class.name

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:1010, in _check_types(x, info, name, types, cast)
1008 _validate_type(x, types, name)
1009 if cast is not None and x is not None:
 → 1010     x = cast(x)
1011 return x

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:1053, in SubjectInfo.init(self, initial)
1051 super().init()
1052 for key, val in initial.items():
 → 1053     self[key] = val

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:960, in ValidatedDict.setitem(self, key, val)
958             raise RuntimeError(self._attributes[key])
959     else:
 → 960         val = self._attributes[key](
961             val, info=self
962         )  # attribute checker function
963 else:
964     class_name = self.class.name

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:1015, in _check_bday(birthday_input, info)
1014 def _check_bday(birthday_input, *, info):
 → 1015     date = _check_types(
1016         birthday_input,
1017         info=info,
1018         name=‘subject_info[“birthday”]’,
1019         types=(datetime.date, None),
1020     )
1021     # test if we have a pd.Timestamp
1022     if hasattr(date, “date”):

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:1008, in _check_types(x, info, name, types, cast)
1007 def _check_types(x, *, info, name, types, cast=None):
 → 1008     _validate_type(x, types, name)
1009     if cast is not None and x is not None:
1010         x = cast(x)

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/utils/check.py:645, in _validate_type(item, types, item_name, type_name, extra)
643 _item_name = “Item” if item_name is None else item_name
644 _item_type = type(item) if item is not None else item
 → 645 raise TypeError(
646     f"{_item_name} must be an instance of {type_name}{extra}, "
647     f"got {_item_type} instead."
648 )

TypeError: subject_info[“birthday”] must be an instance of date or None, got <class ‘tuple’> instead.
1 Like

Thanks for checking the versions.

Can you share some data so we can look into this? Could be via a dropbox link or email. The data could be the epochs object you’re creating the ITC from. Alternatively, if you can copy the Info to some random data and replicate the issue, you could share this.

1 Like

Yes, I can send you a file securely via Renater FileSender. Is there an email address I can use?

You can send it to: thomas-samuel.binns@charite.de

1 Like

I created a fresh environment with MNE 1.10 and I am able to load the TFR file you sent using mne.time_frequency.read_tfrs() without any issues. Can you try reading the file with a fresh environment?

This is good news but strange.

Some more info:
I am using Spyder with the following mne-python version:
/Users/vv221713/Applications/MNE-Python/1.10.1_0/.mne-python/bin/python

I work with Mac Sequoia 15.7.2. and cannot/should not upgrade to Catalina

The mne install is very recent and my computer is new from the summer so not much work reinstall made on it yet

Okay, so I also created a new environment from the installer for 1.10.2_0, and I can still load the data without issue.

Code:

import mne
file = "C:\\Users\\tsbin\\Downloads\\ad230259_egoMEG_itc_combpresent-tfr.h5"
itc = mne.time_frequency.read_tfrs(file)
print(itc)

Output:

Could be there is an issue with your installation of MNE. I would suggest installing 1.10.2_0 using the latest installer.

The failing check was introduced in 2025 June, in

and first appeared in version 1.10.0

Storing info["subject_info"]["birthday"] as a datetime object instead of a tuple was behavior first introduced in MNE 1.8:

I suspect what’s going on is that:

  1. the epochs were created with a version prior to 1.8, and
  2. we never updated the read_epochs code path to convert birthday tuples to datetime objects, and
  3. when the TFR is created from the Epochs, info["subject_info"] is copied over untouched
  4. the TFR writer is still writing tuples because it’s writing to HDF5 (not FIFF) and so the safeguards added in #12720 aren’t kicking in.

@virvw is the file you emailed to @tsbinns an anonymized one that you just saved? If so (and if my earlier speculations are correct), it probably will have a datetime birthday instead of a tuple one, which would explain why he can’t reproduce your errors.

Thank you for your help @tsbinns

I can now replicate opening directly in the python cmd line on the Linux server w/ an old mne-python version

>>> file = "ad230259_egoMEG_itc_combpresent-tfr.h5"
>>> itc = mne.time_frequency.read_tfrs(file)
Reading /neurospin/meg/...
>>> print(itc)
<Inter-trial coherence from Epochs (nave=91), morlet method | 306 channels × 121 freqs × 5501 times, 0.3 - 120.0 Hz, -0.50 - 5.00 s, 1.52 GiB>

The good news is that the code is effectively working.

I installed the latest mne-python on my Mac and unfortunately the same error comes up. Spyder may be the culprit…

So the bad news is that interfaces / IDE go faster than I can keep up with. I’ll tryVSCode and Pycharm

Best,

Virginie

Hi again -

I installed VSCode and tried. I am experiencing the same error there when reading the file (using the same file and the same code).

Maybe an IDE or python version issue (Python 3.13.8)?

mne-python 1.10.2

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[5], line 2
      1 #%% load data
----> 2 tfrs = mne.time_frequency.read_tfrs(fname_in)[0]
      4 #error subject_info["birthday"] must be an instance of date or None, got <class 'tuple'> instead.

File <decorator-gen-179>:12, in read_tfrs(fname, condition, verbose)

File ~/Applications/MNE-Python/1.10.2_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:4119, in read_tfrs(fname, condition, verbose)
   4117 else:
   4118     Klass = RawTFR
-> 4119 out = Klass(inst=hdf5_dict)
   4120 if getattr(out, "metadata", None) is not None:
   4121     out.metadata = _prepare_read_metadata(out.metadata)

File ~/Applications/MNE-Python/1.10.2_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:2911, in AverageTFR.__init__(self, inst, freqs, method, tmin, tmax, picks, proj, decim, comment, n_jobs, verbose, **method_kw)
   2909 else:
   2910     self._comment = getattr(self, "_comment", comment)
-> 2911 super().__init__(
   2912     inst,
   2913     method,
   2914     freqs,
   2915     tmin=tmin,
   2916     tmax=tmax,

...

    646     f"{_item_name} must be an instance of {type_name}{extra}, "
    647     f"got {_item_type} instead."
    648 )

TypeError: subject_info["birthday"] must be an instance of date or None, got <class 'tuple'> instead.

Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...

Hello - following up on this, I ran a simpler code on less data to fasten the troubleshooting.

I systematically replicate :

  • the produced TFR can be read directly from shell python but both Spyder and Visual VS code report the same errors

    
    >>> import mne
    
    >>> tfrs = mne.time_frequency.read_tfrs(‘TEST_egoMEG_pow-tfr.h5’)
    
    Reading /neurospin/meg/meg_tmp/2023_egoMEG_Wagelmans/SCRIPTS/tfr_ref_pipeline/TEST_egoMEG_pow-tfr.h5 …
    
    >>> tfrs
    
    <Average Power Estimates from Epochs (nave=1), morlet method | 306 channels × 121 freqs × 1501 times, 0.3 - 120.0 Hz, -0.50 - 1.00 s, 431.6 MiB>
    
  • on this simplified version of the data, I get a different error on Spyder and VS Code

    Reading /Volumes/neurospin/meg/meg_tmp/2023_egoMEG_Wagelmans/SCRIPTS/tfr_ref_pipeline/TEST_egoMEG_pow-tfr.h5 …
    
    RuntimeError                              Traceback (most recent call last)
    Cell In[13], line 1
    ----> 1 tfrs = mne.time_frequency.read_tfrs(‘TEST_egoMEG_pow-tfr.h5’)
    
    File :12, in read_tfrs(fname, condition, verbose)
    
    File ~/Applications/MNE-Python/1.10.2_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:4110, in read_tfrs(fname, condition, verbose)
    4108 check_fname(fname, “tfr”, valid_fnames)
    4109 logger.info(f"Reading {fname} …")
     → 4110 hdf5_dict = read_hdf5(fname, title=“mnepython”, slash=“replace”)
    4111 # single TFR from TFR.save()
    4112 if “inst_type_str” in hdf5_dict:
    
    File ~/Applications/MNE-Python/1.10.2_0/.mne-python/lib/python3.13/site-packages/h5io/_h5io.py:517, in read_hdf5(fname, title, slash)
    515     return _read(fname)
    516 else:
     → 517     with h5py.File(fname, mode=“r”) as fid:
    518         return _read(fid)
    
    File h5py/_objects.pyx:56, in h5py._objects.with_phil.wrapper()
    
    File h5py/_objects.pyx:57, in h5py._objects.with_phil.wrapper()
    
    File ~/Applications/MNE-Python/1.10.2_0/.mne-python/lib/python3.13/site-packages/h5py/_hl/files.py:648, in File.exit(self, *args)
    645 @with_phil
    646 def exit(self, *args):
    647     if self.id:
     → 648         self.close()
    
    File ~/Applications/MNE-Python/1.10.2_0/.mne-python/lib/python3.13/site-packages/h5py/_hl/files.py:630, in File.close(self)
    624 if self.id.valid:
    625     # We have to explicitly murder all open objects related to the file
    626
    627     # Close file-resident objects first, then the files.
    628     # Otherwise we get errors in MPI mode.
    629     self.id._close_open_objects(h5f.OBJ_LOCAL | ~h5f.OBJ_FILE)
     → 630     self.id._close_open_objects(h5f.OBJ_LOCAL | h5f.OBJ_FILE)
    632     self.id.close()
    633     _objects.nonlocal_close()
    
    File h5py/_objects.pyx:56, in h5py._objects.with_phil.wrapper()
    
    File h5py/_objects.pyx:57, in h5py._objects.with_phil.wrapper()
    
    File h5py/h5f.pyx:355, in h5py.h5f.FileID._close_open_objects()
    
    RuntimeError: Can’t decrement id ref count (unable to close file, errno = 9, error message = ‘Bad file descriptor’)
    
    
    

The TFR file does have a datetime birthday when I read it. However, @virvw also sent me the epochs file, and here I also see a datetime birthday, can compute, save, and load the TFR no problem.

Still, @drammock’s point that I can’t reproduce this because the files (epochs and TFR) were ones you anonymised and just saved could still be the case.

@virvw Are the epochs files you sent me the exact same ones you are using to create the TFR object? And is the TFR file you sent me the exact same one you are trying to load?

@tsbinns Thanks for following up on this.

Yes, I confirm these are the exact same ones.

Yesterday I tried the anonymize function on the epoch data to see if it changed anything but it didn’t (beside anonymizing of course).

@virvw In the terminal where you are able to load that new TFR file, please can you run the following code mne.sys_info() and tfrs.info["subject_info"]["birthday"], and paste the output here.

Sure here you are:

>>> mne.sys_info()

Platform             Linux-5.15.0-157-generic-x86_64-with-glibc2.35

Python               3.11.6 (main, Nov 24 2023, 13:31:23) [GCC 11.4.0]

Executable           /neurospin/unicog/resources/pyenv/versions/VvW_1.0.0/bin/python

CPU                  Intel(R) Xeon(R) Gold 5218 CPU @ 2.30GHz (64 cores)

Memory               93.0 GiB



Core

├☑ mne               1.10.2 (latest release)

├☑ numpy             2.3.4 (unknown linalg bindings (threadpoolctl module not found: No module named 'threadpoolctl'))

├☑ scipy             1.16.3

└☑ matplotlib        3.10.7 (backend=agg)



Numerical (optional)

├☑ pandas            2.3.3

├☑ h5io              0.2.5

├☑ h5py              3.15.1

└☐ unavailable       sklearn, numba, nibabel, nilearn, dipy, openmeeg, cupy



Visualization (optional)

└☐ unavailable       pyvista, pyvistaqt, vtk, qtpy, ipympl, pyqtgraph, mne-qt-browser, ipywidgets, trame_client, trame_server, trame_vtk, trame_vuetify



Ecosystem (optional)

└☐ unavailable       mne-bids, mne-nirs, mne-features, mne-connectivity, mne-icalabel, mne-bids-pipeline, neo, eeglabio, edfio, mffpy, pybv

And for



>>> tfrs.info["subject_info"]["birthday"]

datetime.date(2004, 4, 1)

Thanks for that.
And what does mne.sys_info() look like for you the environment in Spyder or VS Code where you were unable to load the TFR object?

It looks like this

mne.sys_info()
Platform             macOS-15.7.2-arm64-arm-64bit-Mach-O
Python               3.13.8 | packaged by conda-forge | (main, Oct 13 2025, 14:39:11) [Clang 19.1.7 ]
Executable           /Users/vv221713/Applications/MNE-Python/1.10.2_0/.mne-python/bin/python
CPU                  Apple M4 Pro (14 cores)
Memory               24.0 GiB

Core
├☑ mne               1.10.2 (latest release)
├☑ numpy             2.2.6 (OpenBLAS 0.3.28 with 14 threads)
├☑ scipy             1.15.2
└☑ matplotlib        3.10.6 (backend=tkagg)

Numerical (optional)
├☑ sklearn           1.7.2
├☑ numba             0.62.1
├☑ nibabel           5.3.2
├☑ nilearn           0.12.1
├☑ dipy              1.11.0
├☑ openmeeg          2.5.15
├☑ pandas            2.3.3
├☑ h5io              0.2.5
├☑ h5py              3.14.0
└☐ unavailable       cupy

Visualization (optional)
├☑ pyvista           0.46.3 (OpenGL 4.1 Metal - 89.4 via Apple M4 Pro)
├☑ pyvistaqt         0.11.3
├☑ vtk               9.4.2
├☑ qtpy              2.4.3 (PySide6=6.9.0)
├☑ ipympl            0.9.8
├☑ pyqtgraph         0.13.7
├☑ mne-qt-browser    0.7.2
├☑ ipywidgets        8.1.7
├☑ trame_client      3.11.2
├☑ trame_server      3.6.3
├☑ trame_vtk         2.10.0
└☑ trame_vuetify     3.1.0

Ecosystem (optional)
├☑ mne-bids          0.17.0
├☑ mne-nirs          0.7.2
├☑ mne-features      0.3
├☑ mne-connectivity  0.7.0
├☑ mne-icalabel      0.8.0
├☑ mne-bids-pipeline 1.9.0
├☑ neo               0.14.1
├☑ eeglabio          0.1.2
├☑ edfio             0.4.10
├☑ mffpy             0.10.0
└☑ pybv              0.7.6


1 Like

Okay, sorry if I am repeating myself, but just to be 100% sure:

If you run the code below to load the TFR file you sent to me in the same environment as that latest message (the one with this mne.sys_info() output), you get the error below?

Platform             macOS-15.7.2-arm64-arm-64bit-Mach-O
Python               3.13.8 | packaged by conda-forge | (main, Oct 13 2025, 14:39:11) [Clang 19.1.7 ]
Executable           /Users/vv221713/Applications/MNE-Python/1.10.2_0/.mne-python/bin/python
CPU                  Apple M4 Pro (14 cores)
Memory               24.0 GiB

Core
├☑ mne               1.10.2 (latest release)
├☑ numpy             2.2.6 (OpenBLAS 0.3.28 with 14 threads)
├☑ scipy             1.15.2
└☑ matplotlib        3.10.6 (backend=tkagg)

Code:

import mne
file = "your\\file\\path\\here\\ad230259_egoMEG_itc_combpresent-tfr.h5"
itc = mne.time_frequency.read_tfrs(file)
print(itc)

Error:
TypeError: subject_info["birthday"] must be an instance of date or None, got <class 'tuple'> instead.