pynwb.io.device module

class pynwb.io.device.DeviceMapper(spec)[source]

Bases: NWBContainerMapper

Custom mapper for Device objects to handle known schema conflicts between core schema and extensions.

This mapper detects when extensions define Device.model as a string attribute instead of a link to DeviceModel, or when extensions define their own DeviceModel type.

Create a map from AbstractContainer attributes to specifications

Parameters:

spec (DatasetSpec or GroupSpec) – The specification for mapping objects to builders

model_carg(builder, manager)[source]

Handle different model mapping strategies based on detected schema conflicts.

Parameters:
  • builder – The GroupBuilder for the Device

  • manager – The BuildManager

Returns:

The appropriate model object or value based on the mapping strategy

constructor_args = {'model': <function DeviceMapper.model_carg>, 'name': <function ObjectMapper.get_container_name>}
obj_attrs = {}