Skip to content

Conversation

@Pranav-0440
Copy link

Title

Fix generate_value() in BoundedArray to correctly sample within bounds

Description

This PR addresses Issue #12 ("generate_value"), where BoundedArray.generate_value() produced arrays filled with the minimum value instead of generating random values within the [minimum, maximum] range.

Changes

  • Updated generate_value() to sample using np.random.uniform(low, high, size) and cast to dtype.
  • Ensures values respect the spec’s shape, dtype, and bounds.
  • Added unit test test_generate_value_within_bounds() verifying correct behavior.

Why

The previous implementation ignored maximum and did not create meaningful test values.
This update aligns BoundedArray.generate_value() with expected semantics for bounded specs.

All tests passed (165 passed in 4.37s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant