Skip to content

Commit

Permalink
fix(pm4py): removed deprecation warning on semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
fit-alessandro-berti committed Jan 28, 2023
1 parent 23d5b0a commit b32cada
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions pm4py/objects/petri_net/semantics.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import copy
from typing import Counter, Generic, TypeVar

import deprecation

from pm4py.objects.petri_net.obj import PetriNet
from pm4py.objects.petri_net.sem_interface import Semantics

Expand Down Expand Up @@ -60,7 +57,6 @@ def fire(cls, pn: N, transition: T, marking: Counter[P]) -> Counter[P]:
return m_out

class ClassicSemantics(Semantics):
@deprecation.deprecated("2.3.0", "3.0.0", details="this method will be removed, use PetriNetSemantics.is_enabled() instead")
def is_enabled(self, t, pn, m, **kwargs):
"""
Verifies whether a given transition is enabled in a given Petri net and marking
Expand All @@ -77,7 +73,6 @@ def is_enabled(self, t, pn, m, **kwargs):
"""
return is_enabled(t, pn, m)

@deprecation.deprecated("2.3.0", "3.0.0", details="this method will be removed, use PetriNetSemantics.fire() instead")
def execute(self, t, pn, m, **kwargs):
"""
Executes a given transition in a given Petri net and Marking
Expand All @@ -94,7 +89,6 @@ def execute(self, t, pn, m, **kwargs):
"""
return execute(t, pn, m)

@deprecation.deprecated("2.3.0", "3.0.0", details="this method will be removed, use PetriNetSemantics.fire() instead")
def weak_execute(self, t, pn, m, **kwargs):
"""
Execute a transition even if it is not fully enabled
Expand All @@ -112,7 +106,6 @@ def weak_execute(self, t, pn, m, **kwargs):
return weak_execute(t, m)


@deprecation.deprecated("2.3.0", "3.0.0", details="this method will be removed")
def enabled_transitions(self, pn, m, **kwargs):
"""
Returns a set of enabled transitions in a Petri net and given marking
Expand All @@ -129,11 +122,6 @@ def enabled_transitions(self, pn, m, **kwargs):
return enabled_transitions(pn, m)


# 29/08/2021: the following methods have been encapsulated in the ClassicSemantics class.
# the long term idea is to remove them. However, first we need to adapt the existing code to the new
# structure. Moreover, for performance reason, it is better to leave the code here, without having
# to instantiate a ClassicSemantics object.
@deprecation.deprecated("2.3.0", "3.0.0", details="this method will be removed, use PetriNetSemantics.is_enabled() instead")
def is_enabled(t, pn, m):
if t not in pn.transitions:
return False
Expand All @@ -144,7 +132,6 @@ def is_enabled(t, pn, m):
return True


@deprecation.deprecated("2.3.0", "3.0.0", details="this method will be removed, use PetriNetSemantics.fire() instead")
def execute(t, pn, m):
if not is_enabled(t, pn, m):
return None
Expand All @@ -161,7 +148,6 @@ def execute(t, pn, m):
return m_out


@deprecation.deprecated("2.3.0", "3.0.0", details="this method will be removed, use PetriNetSemantics.fire() instead")
def weak_execute(t, m):
m_out = copy.copy(m)
for a in t.in_arcs:
Expand All @@ -173,7 +159,6 @@ def weak_execute(t, m):
return m_out


@deprecation.deprecated("2.3.0", "3.0.0", details="this method will be removed")
def enabled_transitions(pn, m):
enabled = set()
for t in pn.transitions:
Expand Down

0 comments on commit b32cada

Please sign in to comment.