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

[Bug]: Error when validating (dandi validate) file created with matnwb #562

Open
2 tasks done
dustinf1989 opened this issue Feb 7, 2024 · 9 comments
Open
2 tasks done
Labels
category: file issue issue with reading or writing nwb file status: todo something needs to be done

Comments

@dustinf1989
Copy link

What happened?

I created .nwb files using MATLAB but get this error when I try to validate:
D:\emotional_memory_neuronal_analyses\emotional_memory_neuronal_dandi\000887>dandi validate

[pywnb.GENERIC] D:\emotional_memory_neuronal_analyses\emotional_memory_neuronal_dandi\000887\sub-001\sub-001_ses-ENC_behavior+ecephys.nwb — DtypeError.init: incorrect type for 'expected' (got 'RefSpec', expected 'dtype, type, str or list')

What is field the incorrect type?

I ran nwbinspector on the same file and copied the error message to this txt file:
error_message.txt

Can you help me figure this out please?

Thanks!

Steps to Reproduce

I ran nwbinspector on the same file and copied the error message to this txt file:
[error_message.txt](https://github.com/NeurodataWithoutBorders/matnwb/files/14192478/error_message.txt)

Error Message

No response

Operating System

Windows

Matlab Version

R2022b

Code of Conduct

@lawrence-mbf
Copy link
Collaborator

Hi @dustinf1989 , Is it possible for you to provide the source file so we can take a look? If not, we would want a minimal example that recreates this issue with the inspector.

@dustinf1989
Copy link
Author

Hi @lawrence-mbf thank you for the quick response. Sure, I can share the file. You should be able to download it here: https://drive.google.com/file/d/1qkzeef1o8dnvgSvsIQZvwRrijuSEBd5w/view?usp=sharing

@lawrence-mbf
Copy link
Collaborator

Hi @dustinf1989 ,

It looks like the error has something to do with electrode_group in the file; But as far as I can tell, there does not appear to be anything wrong with the type.

@rly @bendichter any thoughts about this?

@dustinf1989
Copy link
Author

Hi @lawrence-mbf

Thanks for checking this out. I edited the size of the 'electrode_group' variable so it is the same size as the 'spike_times' variable but I still get the same error.

Could it be related to the dimensions of waveforms'? The dimensions are [143756×64 single]

The new file is uploaded here: https://drive.google.com/file/d/1n60v9kG25oxMP3Waz1AeTmk3o9UUwhiM/view?usp=drive_link

@ehennestad
Copy link
Collaborator

I was browsing around, could it be related to this issue in PyNWB?
NeurodataWithoutBorders/pynwb#1692

@dustinf1989
Copy link
Author

dustinf1989 commented Feb 12, 2024

I can use this Python code to load the file and create a few basic plots, so the file seems to work, but I still get the same error when trying to validate. Any ideas on how to get around this error?

load_nwb_files.txt

@dustinf1989 dustinf1989 reopened this Feb 12, 2024
@ehennestad ehennestad added the status: need verification potentially solved, but needs verification label Oct 31, 2024
@ehennestad
Copy link
Collaborator

ehennestad commented Oct 31, 2024

Open question: is this due to an issue in matnwb or in pynwb / nwb validator?

@stephprince, would you know?

@ehennestad ehennestad added the category: file issue issue with reading or writing nwb file label Oct 31, 2024
@stephprince
Copy link

stephprince commented Oct 31, 2024

Looking at the file and where it fails during validation, it looks like the error is coming specifically from units/electrode_group. The error message is confusing in this situation because there is a separate bug in HDMF in which the DtypeError message fails for reference data types. I believe the more accurate error message should be:

Units/electrode_group (units/electrode_group): incorrect type - expected 'object reference', got 'float64'

So to answer your question @ehennestad , there is a separate bug in HDMF in displaying the error message, but I believe the file also fails validation because the units/electrode_group is the incorrect type. The schema defines units/electrode_group as a vector of references similar to the group column in the electrodes table, but in the file that was shared it is a vector of float values.

@ehennestad
Copy link
Collaborator

Thanks for looking into this @stephprince !

Todo:
Is there a bug in the matnwb api leading to the units/electrode of these files being of wrong type?

@ehennestad ehennestad added status: todo something needs to be done and removed status: need verification potentially solved, but needs verification labels Oct 31, 2024
@ehennestad ehennestad changed the title [Bug]: [Bug]: Error when validating (dandi validate) file created with matnwb Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: file issue issue with reading or writing nwb file status: todo something needs to be done
Projects
None yet
Development

No branches or pull requests

4 participants