Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random schedule doesn't work with floats #593

Open
Christophe-Foyer opened this issue Jul 26, 2023 · 0 comments
Open

Random schedule doesn't work with floats #593

Christophe-Foyer opened this issue Jul 26, 2023 · 0 comments

Comments

@Christophe-Foyer
Copy link

Hi!

I was just trying to get the scheduler to schedule things at random frequencies after than 1 time a second.
I don't actually care too much about it being perfect, just a useful library to schedule things.

This line is making that impossible: https://github.com/dbader/schedule/blob/master/schedule/__init__.py#L715

Would it be possible to replace the logic with a (maxval-minval)*random.random()+minval maybe? I imagine that's what randrange does internally (or something similar). The only concern is this would be changing the behavior from only integer values being output to non integer values.

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

No branches or pull requests

1 participant