<div dir="ltr"><div dir="ltr">I'm using various rv_continuous distributions as priors for a Bayesian analysis package I'm writing. Part of the GUI functionality is to produce code fragments from the GUI state to encourage scientific reproducibility. i.e. set up the analysis objects in a GUI, then output code that could be run from a script. I'm making a lot of use of __repr__ to produce text that can be used to build the objects. However, I'm stalled at recreating the scipy.stats distributions, and would like to propose that the __repr__ of these classes be improved to a point where the repr can be used to reproduce the distribution.<div><br></div><div>e.g instead of:</div><div><br></div><div>>>> from scipy.stats import norm<br>>>> print(repr(norm(0, 1)))<br><scipy.stats._distn_infrastructure.rv_frozen object at 0x1a17c8f898></div><div><br></div><div>one would get:</div><div><div>norm(0, 1)</div><div><br></div><div>This would require that all the initialisation variables be accessible from the object (which I think was discussed recently if I remember rightly).</div><div><br></div><div>Would others find this useful?</div><div><br></div><div>Andrew.</div><br class="gmail-Apple-interchange-newline"><br>--</div><div><div><div dir="ltr" class="gmail_signature">_____________________________________<br>Dr. Andrew Nelson<br><br><br>_____________________________________</div></div></div></div></div>