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

If so, I am quite stumped :sweat_smile:

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 Says the epochs and TFR files they sent to me are the exact same ones they are computing ITC from and trying to load, respectively, and when I read in both, I see birthday as a datetime.

Pinging also @larsoner for any possible insight since they were involved in some of these changes.

1 Like

Hi @tsbinns I think you debugged that alright!

I went ahead and produced a set of epochs from the same raw data (same participant etc). I performed a quick TFR and the outputs are now readable in Spyder.

The epochs may have originally been created w/ mne-python 1.7

I am going to double check this, and restart the pipeline from there!

Thanks a bunch for these insights.

Let me know if I can help on the resolution of version compatibility issues.

2 Likes

Glad that it’s resolved!

@drammock, do you think read_epochs should be updated to convert birthday tuples to datetime? Should there also be checks in place for reading/writing TFR objects?

@tsbinns yeah it would be good if we could maintain backward compatibility for the old objects we created. So once the data is read, if it’s tuple then convert to date etc.

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.