From fd4250e8697204f8bec70fd7b35911ac7dd4aaab Mon Sep 17 00:00:00 2001 From: Fizmat Date: Sun, 24 Mar 2024 20:01:06 +0400 Subject: [PATCH] fix division by zero when generating less than 100 records --- createMeasurements.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/createMeasurements.py b/createMeasurements.py index b440362..9158769 100644 --- a/createMeasurements.py +++ b/createMeasurements.py @@ -444,7 +444,7 @@ def generateMeasurementFile( f"Creating measurement file '{file_name}' with {records:,} measurements..." ) start = time.time() - progress_report_unit = records // 100 + progress_report_unit = max(records // 100, 1) with open(file_name, "w") as f: for i in range(records): station, measurement = self.generateSingleMeasurement(std_dev=std_dev)