obspy.core.event.resourceid.ResourceIdentifier.set_referred_object

ResourceIdentifier.set_referred_object(referred_object, warn=True, parent=None)[source]

Bind an object to the ResourceIdentifier instance.

Also allows the object to be bound to a parent scope. Will emit a warning if referred_object is not equal to the last object referred to by the same resource_id, or, if the resource_id does not refer to an object that currently exists, the last object assigned to the same resource id code.

Parameters
  • referred_object (object) – The object to which the resource id refers.

  • warn (bool) – If True, issue a warning if the referred_object is not equal to the last object assigned the same resource_id.

  • parent (object, int) – An object or int (id) to which the resource_id should be scoped. Used, for example, to ensure the all resource ids belonging to an event object are event-scoped.