replace
replace(
self ,
old ,
new ,
)-> ‘Self’
Return a new inventory with one component replaced.
This is the correction mechanism: the change applies in place and retroactively. old is matched by equality at any addressable level: networks, stations, channels, fiber arrays, acquisitions, optical paths, and path track items (components, geometry, coupling, annotations); pooled resources are addressed by their resource_id. An old matching more than one item is ambiguous and raises. Singletons such as the CRS or a distance map are corrected with new() on their parent. new must be the same type as old. Note that resource normalization rewrites inline resource objects to id references at construction, so match against the stored (normalized) object — e.g. an acquisition whose interrogator is the id string — not a pre-construction handle holding the inline object.