Support pose estimation objects anywhere in the nwbfile - #17
Conversation
h-mayorquin
left a comment
There was a problem hiding this comment.
This is good. I think this is a critical fix, we can merge it now and then add the tests or if you prefer the other way around.
| # Get only PoseEstimation objects (not Skeletons or other types) | ||
| cameras = {} | ||
| for name, obj in pose_module.data_interfaces.items(): | ||
| for obj in nwbfile.objects.values(): |
There was a problem hiding this comment.
In the edge case of a user that writes pose estimation in two different modules with the same name there will be a collision right?
There was a problem hiding this comment.
Yes, that is true...
There was a problem hiding this comment.
I added an assertion to check that case. I don't think it's likely, so maybe we can just cross that bridge when we come to it, or if you have a better idea, let me know.
| cameras = {} | ||
| for name, obj in pose_module.data_interfaces.items(): | ||
| for obj in nwbfile.objects.values(): | ||
| if type(obj).__name__ == "PoseEstimation": |
There was a problem hiding this comment.
What about obj.neurodata_type == "PoseEstimation" or isinstance(obj, PoseEstimation)
I will try to make a push for:
NeurodataWithoutBorders/pynwb#1737
When I have some time.
Yeah, I think I would prefer the other way around, so that I can add some dedicated tests for pose estimation located in different places like in the behavior processing module. |
Fixes #14