pyGAM
pyGAM copied to clipboard
InvGaussDist.sample crashes when scale=None
While testing the InvGaussDist distribution, I noticed that the sample method directly passes self.scale to numpy.random.wald. Since the default value of scale in InvGaussDist is None, this results in a runtime error because NumPy expects a numeric value.
Minimal Reproduction from pygam.distributions import InvGaussDist dist = InvGaussDist(scale=None) dist.sample(mu=1.0)
Error TypeError: must be real number, not NoneType Expected Behavior Sampling should work even when scale=None, similar to other distributions that fall back to a default scale (e.g., 1.0).
I’d be happy to work on a fix and submit a PR for this.