Skip to content

Commit

Permalink
fix(pm4py): fix OCEL deepcopy
Browse files Browse the repository at this point in the history
  • Loading branch information
fit-alessandro-berti committed Apr 3, 2023
1 parent b47c897 commit d0ee4a8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pm4py/algo/filtering/ocel/activity_type_matching.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from enum import Enum
from pm4py.util import exec_utils, constants
from pm4py.objects.ocel.util import filtering_utils
from copy import copy
from copy import deepcopy
from typing import Dict, Any, Optional, Collection
from pm4py.objects.ocel.obj import OCEL
from pm4py.objects.ocel import constants as ocel_constants
Expand Down Expand Up @@ -51,7 +51,7 @@ def apply(ocel: OCEL, correspondence_dict: Dict[str, Collection[str]],
temp_column = exec_utils.get_param_value(Parameters.TEMP_COLUMN, parameters, "@@temp_column")
temp_separator = exec_utils.get_param_value(Parameters.TEMP_SEPARATOR, parameters, "@#@#")

ocel = copy(ocel)
ocel = deepcopy(ocel)

inv_dict = set()
for ot in correspondence_dict:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import Optional, Dict, Any
from pm4py.algo.transformation.ocel.graphs import object_interaction_graph
from pm4py.objects.ocel.util import filtering_utils
from copy import copy
from copy import deepcopy
from pm4py.util import exec_utils
from enum import Enum
import sys
Expand Down Expand Up @@ -68,7 +68,7 @@ def apply(ocel: OCEL, parameters: Optional[Dict[Any, Any]] = None):
ret = []

for cc in conn_comp:
subocel = copy(ocel)
subocel = deepcopy(ocel)
subocel.objects = subocel.objects[subocel.objects[subocel.object_id_column].isin(cc)]
subocel = filtering_utils.propagate_object_filtering(subocel, parameters=parameters)
ret.append(subocel)
Expand Down
4 changes: 2 additions & 2 deletions pm4py/objects/ocel/util/rename_objs_ot_tim_lex.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pm4py.objects.ocel.obj import OCEL
from copy import copy
from copy import deepcopy


def apply(ocel: OCEL) -> OCEL:
Expand Down Expand Up @@ -35,7 +35,7 @@ def apply(ocel: OCEL) -> OCEL:
objects = {objects[i]: ot + "_" + str(i+1) for i in range(len(objects))}
overall_objects.update(objects)

ocel = copy(ocel)
ocel = deepcopy(ocel)
ocel.objects[ocel.object_id_column] = ocel.objects[ocel.object_id_column].map(overall_objects)
ocel.relations[ocel.object_id_column] = ocel.relations[ocel.object_id_column].map(overall_objects)
ocel.o2o[ocel.object_id_column] = ocel.o2o[ocel.object_id_column].map(overall_objects)
Expand Down

0 comments on commit d0ee4a8

Please sign in to comment.