E-IG0003 — Empty size-range hint
Error Type |
|
|---|---|
Phase |
generating random instance data |
Python exception |
|
Message
Cannot generate a random collection: the size range hint `{range}` is empty.
Possible fix: give the size hint a non-empty range in the generation options.
Cause
The size-range hint supplied to the random generator contains no integer, so no collection size can be drawn from it. Note that Python’s range(a, b) excludes b — range(5, 5) is empty even though its start equals its end — and jm.generation.size.open(3, 4) is empty because no integer lies strictly between 3 and 4.
Fix
Adjust the size entry for the placeholder in the options argument of Problem.generate_random_dataset so that it contains at least one integer:
problem.generate_random_dataset(
options={"a": {"size": range(1, 6)}},
)