Open achimgaedke opened 2 years ago
A minimal implementation would exchange the two uuid.uuid4 calls in the plotly.py code base with
import random
uuid.UUID(bytes=random.randbytes(16), version=4)
This will allow random.seed(42)
to do the trick.
see #1968
The HTML/js contains UUIDs generated by python's built-in
uuid.uuid4
. By nature, those are unique and totally random.But if you generate documents as part of a pipeline (e.g. via https://dvc.org/ ) then it would be great to have them reproducible down to the byte.
The files will be identical except from the UUIDs.
I "solved" this problem by monkey-patching the relevant function:
re-executing this snippet will produce identical files.
It would be great to exchange one function (or set a seed for an internal version of uuid) in plotly instead of hijacking the python built-in.