Skip to content

MockPoseEstimationInterface: hardcoded names in add_to_nwbfile prevent multi-camera testing #1674

@h-mayorquin

Description

@h-mayorquin

Summary

MockPoseEstimationInterface.add_to_nwbfile uses hardcoded names for the device, skeleton, and container, making it impossible to call it multiple times on the same NWBFile to simulate multi-camera setups. This was discovered while trying to use the mock in nwb-video-widgets#16.

Details

get_metadata correctly derives unique names from self.pose_estimation_metadata_key:

device_name = f"Camera{container_name}"
skeleton_name = f"Skeleton{container_name}"

But add_to_nwbfile ignores this and hardcodes:

  • Device name: "MockCamera" (line 935)
  • Skeleton name: "MockSkeleton" (line 939)
  • Container name: "MockPoseEstimation" (line 962)

This means creating two interfaces with different keys and calling add_to_nwbfile on the same NWBFile fails due to duplicate device/skeleton names.

context:

  • nwb-video-widgets#16: attempted to use MockPoseEstimationInterface but had to fall back to custom fixtures due to this limitation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions