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

ERROR:root:ERROR: MATLAB type not supported: affine2d, (uint32) #43

Open
javantahir opened this issue Nov 10, 2022 · 3 comments
Open

ERROR:root:ERROR: MATLAB type not supported: affine2d, (uint32) #43

javantahir opened this issue Nov 10, 2022 · 3 comments

Comments

@javantahir
Copy link

javantahir commented Nov 10, 2022

Hi there. I am trying to load a Matlab file and something curious is happening, which leads me to a few questions. The file contains a Matlab struct with several fields containing cell values. These cells themselves have entries that are cells (or in some cases structs). When I try to load the file using
mat73.loadmat(data.m)
I receive the following error several times.
ERROR:root:ERROR: MATLAB type not supported: affine2d, (uint32)
As far as I know, affine2d is not a Matlab file type so I'm not sure what is going on here. Strangely, after all of these errors, a dictionary is still returned, albeit not quite in the format I would like. For example one of the field values is an 8x8 cell which contains a cell in each element and mat73.loadmat returns a list of lists as advertised. My first question is: what is the convention for unpacking cells into Python lists? Is it row-wise or column-wise? i.e. does the second element of my list correspond to the cell element (1,2) or (2,1)? Additionally, how can I suppress these errors if nothing is really going wrong?

My second question arose when I tried to load specific variables within this data file using
mat73.loadmat(data.m, only_include='variable')
In this case, the previous errors are not thrown, but the dictionary returned only contains None type elements.

Thanks in advance for taking the time!

Best,
Javan

@skjerns
Copy link
Owner

skjerns commented Nov 14, 2022

The first error means that there is a custom MATLAB format embedded somewhere called affine2d. You probably need to convert this value to a standard MATLAB type (like float?). uint32 almost always hide custom, proprietary types, which I'm unable to decode. If any hint appears on how to decode them that would be great, but so far I wasn't lucky.

Probably the affine2d is some form of 2d matrix?

You can supress the errors by setting the logging level of the default logger to "logging.CRITICAL"

Spontaneously I cannot tell you if cells are loaded row major or cell major, I would need to try that out myself (I don't use MATLAB very often tbh). I think I decided on the same way that scipy was doing it.

To your second question: This is probably due to the types being custom and not able to decode. In this case None is returned.

My suggestion:

  • Check if you can trace down where the supposedly custom MATLAB types are and try to convert them to regular cells/arrays.
  • If that does not work, feel free to send me a test file (either upload here or send to [email protected]), but don't expect a speedy response, currently I unfortunately don't have a lot of time until next year

@ssfatemi
Copy link

ssfatemi commented Aug 9, 2023

Hi there,
I got the same errors for other types:

ERROR:root:ERROR: MATLAB type not supported: datetime, (uint32)
ERROR:root:ERROR: MATLAB type not supported: table, (uint32)
ERROR:root:ERROR: MATLAB type not supported: table, (uint32)

Also, there is a long delay while I'm loading my data.

@skjerns
Copy link
Owner

skjerns commented Aug 9, 2023

As said, there's not much I can do :-/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants