ENH/Bug cov_params, generalize, avoid ValueError #1730

Closed
josef-pkt opened this Issue Jun 3, 2014 · 1 comment

Projects

None yet

1 participant

@josef-pkt
Member

insufficient refactoring when cov_params_default was added

        if cov_p is None and self.normalized_cov_params is None:
            raise ValueError('need covariance of parameters for computing '
                             '(unnormalized) covariances')

another improvement:
short-circuit if no arguments are given and we just want cov_params(). There is no need for checking all cases if all arguments are None.

I assume we don't have a subclass yet that does not define normalized_cov_params, so no error or failure so far.

@josef-pkt
Member

there is not really much to short_circuit, it just goes through a few if and ends up returning cov_p

PR in #1772

@josef-pkt josef-pkt closed this in 43ae213 Jun 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment