Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions tests/gen-tests-mk
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,11 @@ def generate_resolutions (resolution_icdf, resolution_min, resolution_max, num_s
# Generate 2D resolutions based on the resolution areas and aspect ratio range
resolutions2d = []
for reso in generated_resolutions:
randreso = np.random.randint (round (reso * min_ratio), round (reso * max_ratio) + 1)
resolutions2d.append ((randreso, round (reso * reso / randreso)))
total_pixels = reso * reso
ratio = random.uniform (min_ratio, max_ratio)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Consider using np.random.uniform instead of random.uniform for consistency with numpy ecosystem (line 93 uses Python's random, but other randomness uses numpy)

Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/gen-tests-mk
Line: 105:105

Comment:
**style:** Consider using `np.random.uniform` instead of `random.uniform` for consistency with numpy ecosystem (line 93 uses Python's random, but other randomness uses numpy)

How can I resolve this? If you propose a fix, please make it concise.

width = round (np.sqrt (total_pixels * ratio))
height = round (np.sqrt (total_pixels / ratio))
resolutions2d.append ((width, height))
return resolutions2d # generated_resolutions

def symlink (target, link):
Expand Down