Skip to content

Commit

Permalink
refactor: moved generating point as function inside generate random data
Browse files Browse the repository at this point in the history
  • Loading branch information
MattOrmianek committed Sep 22, 2024
1 parent d71a7d8 commit 2c21dbd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/data_processing/generate_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ def generate_data(
logger.info(
"Generating %d random data points between %f and %f", num_points, min_value, max_value
)
data = [
(random.uniform(min_value, max_value), random.uniform(min_value, max_value))
for _ in range(num_points)
]

def generate_point() -> Tuple[float, float]:
"""Generate a single random point."""
return (random.uniform(min_value, max_value), random.uniform(min_value, max_value))

data = [generate_point() for _ in range(num_points)]
return data

0 comments on commit 2c21dbd

Please sign in to comment.