vendredi 10 juin 2022

Sympy changes the random seed

I am working on a python 3 project where I use deap and sympy. I set the seed to a fixed value after I imported the random module in the main file.py that I execute in order to have a reproductible code. but then I found out that I do not obtain the same results after I run it more than once (deap uses a lot of random numbers), when I tracked the bug I found that it's in the sympy parsing function sympy.parsing.sympy_parser.parse_expr used to transform a string to a sympy expression. I am pretty sure sympy is messing with the random seed but I have no idea how to rectify it. Any suggestions or ideas would be appreciated and let me know if the problem described is clear or not. Thanks!






Aucun commentaire:

Enregistrer un commentaire