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]: file create date is not appendable if the file is generated by pynwb #550

Closed
2 tasks done
laurelrr opened this issue Oct 23, 2023 · 1 comment
Closed
2 tasks done
Assignees

Comments

@laurelrr
Copy link

What happened?

I recently created an nwb file using the tye-lab-to-nwb neurotensin package on github (a pynwb package). Later, I wanted to change some of the general fields and loaded the file into matlab:

 > nwb = nwbRead('H07_DiscS.nwb');
 > nwb.general_subject.age = 'P109D';
 > nwbExport(nwb,'H07_DiscS.nwb')

but this gave me an error:

Warning: Attempted to change size of continuous dataset `/file_create_date`.  Skipping.
> In io.writeDataset (line 26)
In types.core/NWBFile/export (line 849)
In NwbFile/export (line 66)
In nwbExport (line 42)  

I expected this to write out an updated NWB file. However, the export function tries to add a second date into the 'file_create_date' field:

>> nwb.file_create_date
ans =
  1×2 cell array
    {[2023-10-10T14:38:34.356656-07:00]}    {[2023-10-20T14:54:46.150750-07:00]}

I am working on Windows 11, using Matlab 9.14.0.2286388 (R2023a) Update 3, with matnwb version 2.6.0. installed.
The original file was 'auto-generated using neuroconv'.

Steps to Reproduce

(Using python, inside tye-lab-to-nwb folder)
> conda activate tyenwbevn39
> python src/tye_lab_to_nwb/neurotensin_valence/neurotensin_valence_convert_all_sessions.py

(In matlab)
 > nwb = nwbRead('H07_DiscS.nwb');
 > nwb.general_subject.age = 'P109D';
 > nwbExport(nwb,'H07_DiscS.nwb')

Error Message

Warning: Attempted to change size of continuous dataset `/file_create_date`.  Skipping.
> In io.writeDataset (line 26)
In types.core/NWBFile/export (line 849)
In NwbFile/export (line 66)
In nwbExport (line 42)

Operating System

Windows

Matlab Version

9.14.0.2286388 (R2023a) Update 3

Code of Conduct

@lawrence-mbf lawrence-mbf self-assigned this Oct 23, 2023
@lawrence-mbf
Copy link
Collaborator

This warning message is actually somewhat expected and, indeed, is intended for compatibility with pynwb already since the behavior for editing files in MatNWB will differ slightly from pynwb regarding /file_create_date.

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

2 participants