Skip to content

Commit

Permalink
Remove set to range optimization
Browse files Browse the repository at this point in the history
Apparently, ruamel cannot easily parse YAML containing python ranges. A
better optimization is to make our own RangeList set representation in
the future.
  • Loading branch information
Hendrik Bierlee committed Oct 18, 2023
1 parent aa33d6c commit 0e41bc2
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/minizinc/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ def transform_enum_object(self, obj):
def mzn_object_hook(self, obj):
if isinstance(obj, dict):
if len(obj) == 1 and "set" in obj:
if len(obj["set"]) == 1 and isinstance(obj["set"][0], list):
assert len(obj["set"][0]) == 2
return range(obj["set"][0][0], obj["set"][0][1] + 1)

li = []
for item in obj["set"]:
if isinstance(item, list):
Expand Down

0 comments on commit 0e41bc2

Please sign in to comment.