map attribute name to another

Maps an attribute name to another attribute name. Nothing is returned.

Attribute names that are mapped to another attribute name will allow it to follow that name's value. The name that requests the map, will become the child, and the name that the child maps to becomes the parent. Attribute names for the child and parent must already exist to map them.

This feature works similarly to the concept of a pointer. It also maintains reference to the same object in memory naturally from python's inherent optimization design.

See more information on the mapping concept in the Map Assignment Glyph language section.

Basic Example of mapping a name using default positional parameters

data.map_attr('attr_name_child', 'attr_name_parent')

In this example, we simply map an attribute name that already exists in the MaciDataObj using the map_attr method and pass a string of the child attribute name as the first argument to the method, then pass the parent attribute name as the second argument to the method.

partner methods

Methods that provide related utility to this method

unmap_attr -> Unmap an attribute name get_all_maps -> Get all parent and child maps get_parent_maps -> Get all parent maps get_child_maps -> Get all child maps get_parent_map_chains -> Get parent maps represented as a chain is_parent_map -> Check if attribute name is a parent mapped with children is_child_map -> Check if attribute name is a child mapped to a parent

parameters & arguments

Describes all parameter functionality and accepted data types

child_attr: str

First required positional argument. Accepts strings

Use this parameter to set the child attribute name that will follow the parent attribute name.

parent_attr: str

Second required positional argument. Accepts strings

Use this parameter to set the parent attribute name for the child attribute name to follow.

Last updated