weightedrand icon indicating copy to clipboard operation
weightedrand copied to clipboard

Nit: undeprecate PickSource

Open PointMeAtTheDawn opened this issue 2 years ago • 2 comments

I do want to set my seed, unrelated to lock contention. I want consistent reproduction of my random results with the same seed. Seeding global rand is deprecated (for good reason), so PickSource is the only option using this library.

Keeping the note in the method doc makes sense, but marking the entire method deprecated leaves no supported route for this use case in the library.

PointMeAtTheDawn avatar Aug 14 '23 19:08 PointMeAtTheDawn

Hmm, that’s fair. Deprecation in Go is just a documentation visibility thing at this time so your use case and code will still function as per the compatibility guarantee, but point taken.

I had been planning to re-add custom sources in a future version aligned with the new rand/v2 proposal (since the rand.source interface will change).

Towards designing that future api: In your use case, do you need the ability to use a different rand source on a per function call basis, or would the ability to set a randomness source for a chooser at creation be sufficient?

On Mon, Aug 14, 2023 at 3:21 PM PointMeAtTheDawn @.***> wrote:

I do want to set my seed, unrelated to lock contention. I want consistent reproduction of my random results with the same seed. Seeding global rand is deprecated (for good reason), so PickSource is the only option using this library.

Keeping the note in the method doc makes sense, but marking the entire method deprecated leaves no supported route for this use case in the library.

— Reply to this email directly, view it on GitHub https://github.com/mroth/weightedrand/issues/29, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAJ5SXBCVDLL6HEWEEYXHDXVJ3E7ANCNFSM6AAAAAA3QDY5XQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

mroth avatar Aug 15 '23 01:08 mroth

Personally, setting at creation is sufficient for me.

PointMeAtTheDawn avatar Aug 15 '23 17:08 PointMeAtTheDawn