Skip to content

Resolve "Supply more formats from which XrDataContainer can parse coordinates"

What does this MR do?

This MR allows the XrDataContainer to use other containers in the data tree for its coordinates. It is accessible by setting the coordinate mode to linked or from_path and specifying a relative path as coordinate argument.

This feature is only available when the container is incorporated into a data tree; otherwise, the container is standalone and cannot relate to any other object.

To postpone the path resolution – which becomes necessary as the object i) is initialised before becoming part of the data tree, and ii) the object needs to have proxy support – a new class is added: Link. Objects of this class are assigned an anchor and a relative path to the target object they should link to. To avoid problems with circular referencing, the anchor is stored as weak reference and after resolution of the target, only a weak reference to it is stored in the link.

Link objects forward all unresolved attribute calls to the target object, thus closely emulating their behaviour.

Can this MR be accepted?

  • Implemented the additional coordinate modes: linked/from_path and trivial/indices.
  • Implemented the Link class
  • Tests added (full coverage)
  • Pipeline passes without warnings
  • Changelog entry added and version bumped to 0.9.0rc1
  • Approved by @herdeanu (any issues coming up will be addressed in a follow-up)

Anything to double-check?

Not in particular, nope.

Related issues

Closes #74 (closed)

Edited by Utopia Developers

Merge request reports