Skip to content

fix off-by-one in _build_range and expand_dataset_range for zero_to_value#341

Open
jamesrayammons wants to merge 1 commit intoAffineFoundation:mainfrom
jamesrayammons:fix/off-by-one-zero-to-value
Open

fix off-by-one in _build_range and expand_dataset_range for zero_to_value#341
jamesrayammons wants to merge 1 commit intoAffineFoundation:mainfrom
jamesrayammons:fix/off-by-one-zero-to-value

Conversation

@jamesrayammons
Copy link
Copy Markdown

Summary

  • Fix _build_range(n, "zero_to_value") returning [[0, n-1]] instead of [[0, n]] — since RangeSet uses exclusive end [start, end), the last ID was never sampled
  • Fix expand_dataset_range applying the same off-by-one with new_end = new_value - 1
  • Add tests for _build_range, expand_dataset_range, _extract_field, and resolve_dataset_range_source

Closes #340

@jamesrayammons jamesrayammons changed the title fix off-by-one in _build_range and expand_dataset_range for `zero_to_value fix off-by-one in _build_range and expand_dataset_range for zero_to_value Apr 10, 2026
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.

_build_range and expand_dataset_range off-by-one for zero_to_value — last ID never sampled

1 participant