[SciPy-Dev] stats, distributions, design choices
Fri Jun 14 09:07:19 CDT 2013
Changing all the _argchecks sounds fishy indeed, but since all the pdf-type
methods call _argcheck anyway, the additional cost would not be large.
Moreover, extracting `loc` and `scale` and _argcheck-ing can be factored
out from individual methods to a special method of rv_distrubution. This
would require a bit of fiddling with the arguments of private methods
(_pdf and its relatives), but the upshot is that for frozen all this would
only be done once, at the freezing time.
What would you say?
On Fri, Jun 14, 2013 at 1:44 AM, <firstname.lastname@example.org> wrote:
> On Thu, Jun 13, 2013 at 7:46 PM, Evgeni Burovski
> <email@example.com> wrote:
> >> In general, it's just the pattern that we follow, why do we have nans
> >> and masked arrays?
> > That I understand --- I just like signalling NaNs much more than quite
> > so was trying to sneak one in.
> > Anyway, if it doesn't match the usage, it's over; thanks for the
> > clarification!
> raising an exception is too drastic as change in behavior/pattern in
> my opinion, but I'm thinking whether we could issue a special warning.
> A warning could be set by users to raise an exception.
> Checking the scale would be easy, that's in one central location.
> However, checking the shape parameter relies on the individual
> `_argcheck` and on the calls to them in each method. To change those,
> we would have to either change all _argchecks which I don't think is a
> good idea, or to change all methods.
> In the methods (at least most of them) it would not incur any
> additional cost to check if there are any invalid parameters, or it
> would not cost much, depending on where the check is done.
> (based on what I remember, I didn't check the current code.)
> I wouldn't be opposed to that, but Ralf is the expert on warnings.
> > Zhenya
> > _______________________________________________
> > SciPy-Dev mailing list
> > SciPy-Dev@scipy.org
> > http://mail.scipy.org/mailman/listinfo/scipy-dev
> SciPy-Dev mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-Dev