sdvillal / whatami

Easily provide python objects with self-identification
Other
9 stars 1 forks source link

Support scipy.stats #1

Open sdvillal opened 9 years ago

sdvillal commented 9 years ago

At the moment we cannot really make probability distributions in scipy.stats to self-identify.

>>> from scipy.stats import norm
>>> type(norm)
scipy.stats._continuous_distns.norm_gen
>>> type(norm(1, 3))
scipy.stats._distn_infrastructure.rv_frozen

Vanilla introspection on these objects fails to separate id keys from object state, so manual code is in order.

sdvillal commented 8 years ago

Probably the best place for this is a plugin + a function to decorate all of the required objects (e.g. random variables).

Also the sklearn wrapper would probably benefit from its own plugin + an optional function to monkey-patch required objects.