Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide users with an option to display augmented lineage data #76

Open
MariellaCC opened this issue Nov 12, 2024 · 1 comment
Open

Comments

@MariellaCC
Copy link

MariellaCC commented Nov 12, 2024

Hi,
This feature request follows a need expressed by @stakats and the DHARPA team in the past.
The need is to be able to display augmented lineage data optionally, as is done currently with the workaround code below, which displays the input values or previews. Would it be possible to have the option to have such an augmented version of the lineage displayed by Kiara directly (as an option) so that this is done more efficiently than in the code snippet below?

def augment_lineage_data(item,kiara):

    graph = item.lineage.module_graph
    
    nodes = graph.nodes.data()
    augmented_nodes = dict()


    def get_info(node):
            # all this is terribly inefficient
            
            if node[1]["node_type"] == "operation":
                
                result = kiara.retrieve_module_type_info(node[1]["module_type"]).dict()
            
            elif node[1]["node_type"] == "value":
                
                value_id = node[0][6:]
                
                v = kiara.get_value(value_id)
                if v.is_set:
                    render_result = kiara.render_value(value=v, target_format="string").rendered
                    
                else:
                    render_result = "None"

                result = {
                    "preview": render_result
                }
            
            return result

    for idx, node in enumerate(nodes):
            node_dict = {
                "id": node[0],
                "desc": node[1],
                "parentIds": [pred for pred in graph.predecessors(node[0])],
                "info": get_info(node)
            }
            augmented_nodes[idx] = node_dict

    return augmented_nodes
@MariellaCC MariellaCC changed the title give users an option to display augmented lineage data Provide users with an option to display augmented lineage data Nov 12, 2024
@MariellaCC
Copy link
Author

As discussed during the dev meeting today, more info on this feature request may be added by @CBurge95 in case we need to incorporate the comments as well in the lineage data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant