Skip to content

Commit

Permalink
Merge 8c9c159 into 55f2512
Browse files Browse the repository at this point in the history
  • Loading branch information
fredcallaway committed Mar 12, 2019
2 parents 55f2512 + 8c9c159 commit 51b2c4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion RELEASE-NOTES.md
Expand Up @@ -8,7 +8,7 @@
- `GLM.from_formula` and `LinearComponent.from_formula` can extract variables from the calling scope. Customizable via the new `eval_env` argument. Fixing #3382.

### Maintenance

- Add `sigma`, `tau`, and `sd` to signature of `NormalMixture`.
- All occurances of `sd` as a parameter name have been renamed to `sigma`. `sd` will continue to function for backwards compatibility.
- Made `BrokenPipeError` for parallel sampling more verbose on Windows.
- Added the `broadcast_distribution_samples` function that helps broadcasting arrays of drawn samples, taking into account the requested `size` and the inferred distribution shape. This sometimes is needed by distributions that call several `rvs` separately within their `random` method, such as the `ZeroInflatedPoisson` (Fix issue #3310).
Expand Down
10 changes: 4 additions & 6 deletions pymc3/distributions/mixture.py
Expand Up @@ -564,12 +564,10 @@ class NormalMixture(Mixture):
Note: You only have to pass in sigma or tau, but not both.
"""

def __init__(self, w, mu, comp_shape=(), *args, **kwargs):
if 'sd' in kwargs.keys():
kwargs['sigma'] = kwargs.pop('sd')

_, sigma = get_tau_sigma(tau=kwargs.pop('tau', None),
sigma=kwargs.pop('sigma', None))
def __init__(self, w, mu, sigma=None, tau=None, sd=None, comp_shape=(), *args, **kwargs):
if sd is not None:
sigma = sd
_, sigma = get_tau_sigma(tau=tau, sigma=sigma)

self.mu = mu = tt.as_tensor_variable(mu)
self.sigma = self.sd = sigma = tt.as_tensor_variable(sigma)
Expand Down

0 comments on commit 51b2c4c

Please sign in to comment.