Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

h5py cannot save dictionary fields that contain ragged nested lists #144

Open
jacob-prince opened this issue Jul 3, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@jacob-prince
Copy link
Collaborator

  • some entries in the dictionaries that glmsingle.py generates may be of type list, and it's not clear that this is desirable, since h5py cannot save ragged nested lists (errors out)

  • for example, in this dictionary, pcregressors and rrbadness are of type list. we should check whether this is necessary, and if so, fix the h5py saving to prevent bugs if the users generate ragged nested lists (e.g. pcregressors could be a list of arrays of different shape).

outdict = {
'HRFindex': HRFindex,
'HRFindexrun': HRFindexrun,
'glmbadness': glmbadness,
'pcvoxels': pcvoxels,
'pcnum': pcnum,
'xvaltrend': xvaltrend,
'noisepool': noisepool,
'pcregressors': pcregressors,
'betasmd': modelmd,
'R2': R2,
'R2run': R2run,
'rrbadness': rrbadness,
'FRACvalue': FRACvalue,
'scaleoffset': scaleoffset,
'meanvol': meanvol
}

  • whenever h5py attempts to save a field that is an np array with type Object, there will be an error in create_dataset. this relates to lines such as the following, which will not cause issues if the entries in the list are the same shape. but, that will not always be the case.
image
@jacob-prince jacob-prince added the bug Something isn't working label Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants