Skip to content

Commit

Permalink
fixed range to be integers above 1 if max value is above 1
Browse files Browse the repository at this point in the history
  • Loading branch information
a-baur committed Mar 19, 2024
1 parent d41d9e3 commit 858639d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mtl_evaluation/mtl_refinement.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ def refine_predicate(self, predicate_name, metric_name,) -> Tuple[Tuple[int, int

if max_value > 1:
# round values to the nearest multiple of 5
min_value = min_value - (min_value % 5)
max_value = max_value + (5 - (max_value % 5))
step = max(1, step) # step should be at least 1
_range = np.arange(int(min_value), int(max_value), int(step))
min_value = int(min_value - (min_value % 5))
max_value = int(max_value + (5 - (max_value % 5)))
step = int(max(1, step)) # step should be at least 1
_range = np.arange(min_value, max_value, step)
else:
# round min, max and step to 5 decimal places for return
min_value = np.round(min_value, 5)
Expand Down

0 comments on commit 858639d

Please sign in to comment.