Closed lkeegan closed 2 years ago
I might have found a way to convert the pynwb file back into a dict:
nwbfile_dict = nwb_metadata.get("NWBFile")
subject_dict = nwb_metadata.get("Subject")
{key: pynwb_file.fields[key] for key in nwbfile_dict}
{key: pynwb_file_1.subject.fields[key] for key in subject_dict}
There are two possible (very similar) formats for nwb
metadata
depending on use case:NWBFile(**metadata)
using thepynwb
librarySubject
gets the schema from hdmf5: https://github.com/catalystneuro/nwb-conversion-tools/blob/29bde208caf6e5a1dece80d77b9bdd0082d7ee74/src/nwb_conversion_tools/utils/json_schema.py#L128Failed validating 'type' in schema['properties']['Subject']['properties']['weight']: {'default': '0.02 g', 'description': 'The weight of the subject, including units. Using ' 'kilograms is recommended. e.g., "0.02 kg". If a float ' 'is provided, then the weight will be stored as ' '"[value] kg".', 'type': 'number'}