You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
It's not possible for me to produce consistent output because there's no option to include a seed.
My use-case is hashing serializable objects, and using their hash as a random seed to give them a human-readable alias which is generated using wonderwords.
Describe the solution you'd like
I'd like an option to set the seed/random state in wonderwords.
Describe alternatives you've considered
It appears that using Python's random.seed(...) affects the random state of wonderwords. However it isn't enough. It does work during a Python session (i.e. it produces consistent results), but not across different sessions.
This allows me to produce consistent output when using random_noun(seed) during a program. It's a 'pure function', in the sense that it gives the same output for the same input, with no (known) side effects. However, if I quit Python and run a program again, the results of random_noun(seed) are changed. This means I cannot reproduce behaviour across different runs of the program.
The text was updated successfully, but these errors were encountered:
I didn't even think about that use-case. I think the issue might be that internally in some places Wonderwords uses sets which have no guaranteed ordering. Setting the seed is definitely a valid concern, so I am looking for ways around that
Is your feature request related to a problem? Please describe.
It's not possible for me to produce consistent output because there's no option to include a seed.
My use-case is hashing serializable objects, and using their hash as a random seed to give them a human-readable alias which is generated using
wonderwords
.Describe the solution you'd like
I'd like an option to set the seed/random state in
wonderwords
.Describe alternatives you've considered
It appears that using Python's
random.seed(...)
affects the random state ofwonderwords
. However it isn't enough. It does work during a Python session (i.e. it produces consistent results), but not across different sessions.For example, consider this function:
This allows me to produce consistent output when using
random_noun(seed)
during a program. It's a 'pure function', in the sense that it gives the same output for the same input, with no (known) side effects. However, if I quit Python and run a program again, the results ofrandom_noun(seed)
are changed. This means I cannot reproduce behaviour across different runs of the program.The text was updated successfully, but these errors were encountered: