Skip to content

Commit

Permalink
re-added get_version with deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
Framba-Luca committed Oct 24, 2023
1 parent 0b15020 commit 4c63224
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions unified_planning/model/problem_kind.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from functools import cache, partialmethod, total_ordering
from itertools import chain
from typing import Dict, Iterable, List, Optional, Set
from warnings import warn
import unified_planning as up

from unified_planning.model.problem_kind_versioning import (
Expand Down Expand Up @@ -279,6 +280,10 @@ def version(self) -> int:
), "Calculated version is > that the LATEST declared version"
return max_version

def get_version(self) -> Optional[int]:
warn(DeprecationWarning("Use version property instead."))
return self.version

def union(self, oth: "ProblemKind") -> "ProblemKind":
"""
Returns a new `ProblemKind` that is the union of this `ProblemKind` and
Expand Down

0 comments on commit 4c63224

Please sign in to comment.