The warning which is raised in types.util.checkUnset could be improved and should be different depending on context:
1) When creating types with properties that are not part of the schema:
types.hdmf_common.VectorIndex('test', 1)
Warning: Unexpected properties {test}.
Your schema version may be incompatible with the file. Consider checking the schema version of the file with
`util.getSchemaVersion(filename)` and comparing with the YAML namespace version present in nwb-schema/core/nwb.namespace.yaml
> In types.util.checkUnset (line 18)
In types.hdmf_common.VectorIndex (line 27)
ans =
VectorIndex with properties:
target: []
description: ''
data: []
In this case the issue is not related to the schema version so this warning message is misleading.
2) When reading a file:
>> nwbRead('~/sub-mouse-INETJ_ses-20200407-sample-10_slice-20200407-slice-1_cell-20200407-sample-10_icephys.nwb')
Warning: Unexpected properties {description}.
Your schema version may be incompatible with the file. Consider checking the schema version of the file with
`util.getSchemaVersion(filename)` and comparing with the YAML namespace version present in nwb-schema/core/nwb.namespace.yaml
> In types.util.checkUnset (line 18)
In types.hdmf_common.VectorIndex (line 23)
In io.parseDataset (line 81)
In io.parseGroup (line 22)
In io.parseGroup (line 38)
In io.parseGroup (line 38)
In io.parseGroup (line 38)
In nwbRead (line 79)
This warning message very little information about which dataset the read operation failed and is difficult to debug.
Suggestion:
Make warning message that:
Clearly states which data type the mentioned property does not belong to.
When reading, state which location in the file the warning is relevant for.
The warning which is raised in
types.util.checkUnset
could be improved and should be different depending on context:1) When creating types with properties that are not part of the schema:
In this case the issue is not related to the schema version so this warning message is misleading.
2) When reading a file:
This warning message very little information about which dataset the read operation failed and is difficult to debug.
Suggestion: Make warning message that: