Commit 19e6cfaf authored by Jérome Perrin's avatar Jérome Perrin

DistributionFitting: if there's an error, fail with the proper error message

instead of returning None that will fail anyway later without meaningul message
parent e80075f5
......@@ -43,6 +43,7 @@ class Distributions:
try: #try..except syntax to test if the data sample fits to Normal distribution
self.Normal= rFitDistr(data,'Normal') #It fits the normal distribution to the given data sample
except RRuntimeError:
raise
return None #If it doesn't fit Return None
myDict = {'distributionType':'Normal','mean':self.Normal[0][0],'stdev': self.Normal[0][1],'min':0, 'max':(self.Normal[0][0]+3*self.Normal[0][1])} #Create a dictionary with keys distribution's and distribution's parameters names and the parameters' values
return myDict #If there is no Error return the dictionary with the Normal distribution parameters for the given data sample
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment