hdmf icon indicating copy to clipboard operation
hdmf copied to clipboard

[Bug]: Lack of error when writing containers that have no mapping in the TypeMap

Open rly opened this issue 1 year ago • 0 comments

What happened?

See https://github.com/rly/ndx-pose/issues/36 for a MWE.

An informative error should be raised when a user tries to write an AbstractContainer object or really any object within the file hierarchy that is not known by HDMF (e.g., it is mapped to a spec or it is a DataChunkIterator or DataIO object -- there may be others in this category).

This is particularly bad in the example above where the user imports an extension after creating the IO object, so the IO object does not know about the extension, and then the user adds extension containers to the file and tries to write the file. HDMF/PyNWB writes the file without those extension containers and raises no warning or error.

Steps to Reproduce

See above.

Traceback

No response

Operating System

macOS

Python Executable

Conda

Python Version

3.12

Package Versions

No response

rly avatar Nov 14 '24 00:11 rly