SURGroup / UQpy

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

Unit tests: LHS class 100% line coverage. #114

Closed mohitcek closed 2 years ago

mohitcek commented 3 years ago

LHS test cases and minor changes related to samples attribute

Description

A script "test_LHS.py" is added in the "tests\SampleMethods" directory. It contains 16 test cases that provide 100% line coverage on the LHS class. Also, changes related to "nsamples" attribute have been made.

Motivation and Context

While initiating an LHS object, the code checks, if "nsamples" is an integer or not. The code raise an error, if it is not an integer. So after that line if-else statement, checking if self.nsamples is None, will never be satisfied. Thus, I have removed such conditions and introduced a check on "nsamples" attribute, inside the "run" method.

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

Checklist:

Go over all the following points, and put an x in all the boxes that apply. If you're unsure about any of these, don't hesitate to ask. We're here to help!

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

100.0% 100.0% Coverage
0.0% 0.0% Duplication

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

100.0% 100.0% Coverage
0.0% 0.0% Duplication