SURGroup / UQpy

UQpy (Uncertainty Quantification with python) is a general purpose Python toolbox for modeling uncertainty in physical and mathematical systems.
MIT License
271 stars 79 forks source link

run_lhs() method erroneously treats the Distribution class as if it had a "params" attribute #48

Closed jjramsey closed 5 years ago

jjramsey commented 5 years ago

(FYI, this is a follow-up to a problem I had e-mailed mds2120 about directly.)

In the method run_lhs() defined in UQpy/SampleMethods.py, line 203 reads as follows:

 samples_u_to_x[:, j] = i_cdf(samples[:, j], self.distribution[j].params)

However, this is wrong, and running run_lhs() leads to an exception with the error message: AttributeError: 'Distribution' object has no attribute 'params'.

The fix for this is straightforward. Change the line to read as follows:

 samples_u_to_x[:, j] = i_cdf(samples[:, j], self.dist_params[j])

Then, run_lhs() should work as intended.

mds2120 commented 5 years ago

This issue should be resolved. Please let us know if it has not been.