Skip to content

Support fractional bounds for randomized job intervals - #669

Open
GreedyC wants to merge 1 commit into
dbader:masterfrom
GreedyC:codex/fractional-random-intervals-593
Open

GreedyC wants to merge 1 commit into
dbader:masterfrom
GreedyC:codex/fractional-random-intervals-593

Conversation

@GreedyC

@GreedyC GreedyC commented Oct 14, 2026

Copy link
Copy Markdown

Changes

Fixes #593.

Support fractional bounds in randomized job intervals, for example schedule.every(0.25).to(0.5).seconds.do(job).

When either bound is a float, sample with random.uniform. Non-float integer bounds retain random.randint, preserving existing integer output and random-state behavior. Update the public interval/latest annotations and document the distinction.

General interval validation is unchanged; the separate upstream proposal #658 addresses that scope.

Verification

  • Nine fractional-bound/unit-scaling subcases fail on the original production code; the integer-sampling control passes.
  • Full suite on Python 3.12 and Python 3.10 / macOS arm64: 84 passed plus 9 subtests passed on each, 99% coverage.
  • Tests cover fractional/mixed/equal bounds, resampling after execution, integer sampler compatibility, and seconds/minutes/hours/days/weeks conversion.
  • Full mypy check passed.
  • Repository-wide formatting check passed with the required Black 20.8b1.
  • Sphinx HTML build passed with warnings as errors.
  • Wheel/sdist builds and Twine checks passed.
  • Read-only local Copilot review found no actionable introduced defects.

Python 3.7–3.9/3.11 and other operating systems were not exercised locally. No dependencies changed.

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.

Random schedule doesn't work with floats

1 participant