diff --git a/tsperf/util/float_simulator/__init__.py b/tsperf/util/float_simulator/__init__.py index 034e0d5..f3ffd2a 100644 --- a/tsperf/util/float_simulator/__init__.py +++ b/tsperf/util/float_simulator/__init__.py @@ -134,7 +134,9 @@ def _decide_factor(self): change_direction = 1 chance = (50 * self.standard_deviation) - distance - return continue_direction if random.randint(0, (100 * self.standard_deviation)) < chance else change_direction + return ( + continue_direction if random.randint(0, int(100 * self.standard_deviation)) < chance else change_direction + ) def _new_error_value(self): self.error_count += 1 diff --git a/tsperf/write/model/sensor.py b/tsperf/write/model/sensor.py index f41f3f6..70a4a5d 100644 --- a/tsperf/write/model/sensor.py +++ b/tsperf/write/model/sensor.py @@ -34,4 +34,4 @@ def __init__(self, schema): self.true_ratio = self.schema["true_ratio"]["value"] def calculate_next_value(self) -> bool: - return random.randint(0, (1 / self.true_ratio)) < 1 # noqa:S311 + return random.randint(0, int(1 / self.true_ratio)) < 1 # noqa:S311