Bi-directional datatype mapping between OML and Python using Altair Compose


Bi-directional datatype mapping between OML and Python using Altair Compose v2023

With the new release of Altair Compose v2023, OML Python Bridge commands provide importing and exporting the class objects. 

Use Case #1: Importing Python Object Class to OML

Let is say that there is a Python class object “PyCircle” defined as below: 

Once implemented the bridge (discussed with details further), executing in Python Command window: 

Value “9” is being assigned to the object class, then it can be read on OML executing this command on OML Command window: 

Use Case #2: Exporting OML Object Class to Python 

Let is say that there is an OML class object “OmlCircle” defined as below: 

Once implemented the bridge, executing the following commands on OML Command window: 

Value “9” is being assigned to the object class, and this is being sent to Python. Finally, it can be read on Python executing these commands on OML Command window: 

As expected, value “9” and the methods are obtained and they can be used to any application, including, assigning this to one Python class object!

It is important to highlight that these 2 steps, even though presented separately, can be used together.

If you want more details about the necessary infrastructure (simply an OML code) to make this work, please access Compose Help: https://help.altair.com/compose/help/en_us/topics/compose/map_oml_class_python_object_r.htm?hl=mapping