Exemple #1
0
def view_sna(sna_metric):
    """
    Represents a SNA metric (.html)

    Parameters
    ---------------
    sna_metric
        Values of the metric
    """
    from pm4py.visualization.sna import visualizer as sna_visualizer
    gviz = sna_visualizer.apply(sna_metric, variant=sna_visualizer.Variants.PYVIS)
    sna_visualizer.view(gviz)
Exemple #2
0
def execute_script():
    log = xes_importer.apply(
        os.path.join("..", "tests", "input_data", "running-example.xes"))

    hw_values = sna_algorithm.apply(
        log, variant=sna_algorithm.Variants.HANDOVER_LOG)
    wt_values = sna_algorithm.apply(
        log, variant=sna_algorithm.Variants.WORKING_TOGETHER_LOG)
    sub_values = sna_algorithm.apply(
        log, variant=sna_algorithm.Variants.SUBCONTRACTING_LOG)
    ja_values = sna_algorithm.apply(
        log, variant=sna_algorithm.Variants.JOINTACTIVITIES_LOG)

    gviz_sub = pn_vis.apply(
        sub_values,
        variant=pn_vis.Variants.NETWORKX,
        parameters={pn_vis.Variants.NETWORKX.value.Parameters.FORMAT: "svg"})
    gviz_hw = pn_vis.apply(hw_values, variant=pn_vis.Variants.PYVIS)
    gviz_wt = pn_vis.apply(
        wt_values,
        variant=pn_vis.Variants.NETWORKX,
        parameters={pn_vis.Variants.NETWORKX.value.Parameters.FORMAT: "svg"})
    gviz_ja = pn_vis.apply(ja_values, variant=pn_vis.Variants.PYVIS)

    pn_vis.view(gviz_sub, variant=pn_vis.Variants.NETWORKX)
    pn_vis.view(gviz_hw, variant=pn_vis.Variants.PYVIS)
    pn_vis.view(gviz_wt, variant=pn_vis.Variants.NETWORKX)
    pn_vis.view(gviz_ja, variant=pn_vis.Variants.PYVIS)
Exemple #3
0
    parameters={variants_filter.Parameters.POSITIVE: False})

# part of the analysis was to eliminate unwanted actions, the code below does just that.
# it is not needed to run the network however if you want to filter these activities out: uncomment it and then change
# the name in network algo sections from filtered_log1 to filtered_log2

# event_log1 = pm4py.convert_to_event_stream(filtered_log1)
# filtered_log2 = pm4py.filtering.filter_event_attribute_values(filtered_log1, 'concept:name',
#                                                               {"O_SELECTED", "O_CREATED", "O_ACCEPTED",
#                                                                "A_REGISTERED", "A_ACTIVATED",
#                                                                "O_CANCELLED", "O_DECLINED", 'A_PARTLYSUBMITTED'},
#                                                               level='event', retain=False)

# Network algorithm sections

# Handover of Work
hw_values = sna.apply(filtered_log1, variant=sna.Variants.HANDOVER_LOG)
gviz_hw_py = sna_visualizer.apply(hw_values,
                                  variant=sna_visualizer.Variants.PYVIS)
sna_visualizer.view(gviz_hw_py, variant=sna_visualizer.Variants.PYVIS)

# Subcontracting
# sub_values = sna.apply(filtered_log2, variant=sna.Variants.SUBCONTRACTING_LOG)
# gviz_sub_py = sna_visualizer.apply(sub_values, variant=sna_visualizer.Variants.PYVIS)
# sna_visualizer.view(gviz_sub_py, variant=sna_visualizer.Variants.PYVIS)

# Working Together
# wt_values = sna.apply(filtered_log2, variant=sna.Variants.WORKING_TOGETHER_LOG)
# gviz_wt_py = sna_visualizer.apply(wt_values, variant=sna_visualizer.Variants.PYVIS)
# sna_visualizer.view(gviz_wt_py, variant=sna_visualizer.Variants.PYVIS)