richvalues 4.2.23__tar.gz → 4.2.25__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {richvalues-4.2.23/richvalues.egg-info → richvalues-4.2.25}/PKG-INFO +1 -1
- {richvalues-4.2.23 → richvalues-4.2.25}/pyproject.toml +1 -1
- {richvalues-4.2.23 → richvalues-4.2.25}/richvalues/__init__.py +58 -53
- {richvalues-4.2.23 → richvalues-4.2.25/richvalues.egg-info}/PKG-INFO +1 -1
- {richvalues-4.2.23 → richvalues-4.2.25}/setup.py +1 -1
- {richvalues-4.2.23 → richvalues-4.2.25}/LICENSE +0 -0
- {richvalues-4.2.23 → richvalues-4.2.25}/README.md +0 -0
- {richvalues-4.2.23 → richvalues-4.2.25}/richvalues.egg-info/SOURCES.txt +0 -0
- {richvalues-4.2.23 → richvalues-4.2.25}/richvalues.egg-info/dependency_links.txt +0 -0
- {richvalues-4.2.23 → richvalues-4.2.25}/richvalues.egg-info/requires.txt +0 -0
- {richvalues-4.2.23 → richvalues-4.2.25}/richvalues.egg-info/top_level.txt +0 -0
- {richvalues-4.2.23 → richvalues-4.2.25}/setup.cfg +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "richvalues"
|
|
7
|
-
version = "4.2.
|
|
7
|
+
version = "4.2.25"
|
|
8
8
|
description = "Python package for working with uncertainties and upper/lower limits"
|
|
9
9
|
license = {file="LICENSE"}
|
|
10
10
|
authors = [{name="Andrés Megías Toledano"}]
|
|
@@ -37,7 +37,7 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
37
37
|
POSSIBILITY OF SUCH DAMAGE.
|
|
38
38
|
"""
|
|
39
39
|
|
|
40
|
-
__version__ = '4.2.
|
|
40
|
+
__version__ = '4.2.25'
|
|
41
41
|
__author__ = 'Andrés Megías Toledano'
|
|
42
42
|
|
|
43
43
|
import copy
|
|
@@ -633,7 +633,7 @@ class RichValue():
|
|
|
633
633
|
is_uplim = True
|
|
634
634
|
else:
|
|
635
635
|
main = np.nan
|
|
636
|
-
unc = [np.nan]*2
|
|
636
|
+
unc = [np.nan]*2
|
|
637
637
|
|
|
638
638
|
if np.isnan(main):
|
|
639
639
|
is_uplim, is_lolim, is_range = False, False, False
|
|
@@ -876,7 +876,7 @@ class RichValue():
|
|
|
876
876
|
"""Constant value."""
|
|
877
877
|
isconst = self.is_exact and self.domain[0] == self.domain[1]
|
|
878
878
|
return isconst
|
|
879
|
-
@property
|
|
879
|
+
@property
|
|
880
880
|
def center(self):
|
|
881
881
|
"""Central value."""
|
|
882
882
|
if self.is_centered or self.is_exact:
|
|
@@ -885,7 +885,7 @@ class RichValue():
|
|
|
885
885
|
cent = round(cent)
|
|
886
886
|
else:
|
|
887
887
|
cent = np.nan
|
|
888
|
-
return cent
|
|
888
|
+
return cent
|
|
889
889
|
@property
|
|
890
890
|
def unc_T(self):
|
|
891
891
|
"""Uncertainties with shape (2,1)."""
|
|
@@ -915,7 +915,7 @@ class RichValue():
|
|
|
915
915
|
else:
|
|
916
916
|
s_n = [np.nan]*2
|
|
917
917
|
return s_n
|
|
918
|
-
@property
|
|
918
|
+
@property
|
|
919
919
|
def ampl(self):
|
|
920
920
|
"""Amplitudes."""
|
|
921
921
|
m, b = self.main, self.domain
|
|
@@ -1063,7 +1063,7 @@ class RichValue():
|
|
|
1063
1063
|
m = float(np.median(sample))
|
|
1064
1064
|
else:
|
|
1065
1065
|
m = np.nan
|
|
1066
|
-
return m
|
|
1066
|
+
return m
|
|
1067
1067
|
|
|
1068
1068
|
def mean(self, num_points=int(1e4), sigmas=8.):
|
|
1069
1069
|
"""Mean of the PDF of the rich value."""
|
|
@@ -1445,7 +1445,7 @@ class RichValue():
|
|
|
1445
1445
|
if 'e' in y:
|
|
1446
1446
|
y, a = y.split('e')
|
|
1447
1447
|
if 'e' in dy:
|
|
1448
|
-
dy, a = dy.split('e')
|
|
1448
|
+
dy, a = dy.split('e')
|
|
1449
1449
|
else:
|
|
1450
1450
|
a = 0
|
|
1451
1451
|
else:
|
|
@@ -1479,10 +1479,10 @@ class RichValue():
|
|
|
1479
1479
|
else:
|
|
1480
1480
|
if is_lolim:
|
|
1481
1481
|
symbol = '>'
|
|
1482
|
-
y = int(np.floor(x)) if is_int and a > num_sf else x
|
|
1482
|
+
y = int(np.floor(x)) if is_int and a > num_sf else x
|
|
1483
1483
|
elif is_uplim:
|
|
1484
1484
|
symbol = '<'
|
|
1485
|
-
y = int(np.ceil(x)) if is_int and a > num_sf else x
|
|
1485
|
+
y = int(np.ceil(x)) if is_int and a > num_sf else x
|
|
1486
1486
|
y = round_sf(y, num_sf, min_exp, extra_sf_lim)
|
|
1487
1487
|
if 'e' in y:
|
|
1488
1488
|
y, a = y.split('e')
|
|
@@ -1790,7 +1790,7 @@ class RichValue():
|
|
|
1790
1790
|
if domain[0] > 0. and other_.sign() != -1:
|
|
1791
1791
|
domain[0] = 0.
|
|
1792
1792
|
if domain[1] < 0. and other_.sign() != 1:
|
|
1793
|
-
domain[1] = 0.
|
|
1793
|
+
domain[1] = 0.
|
|
1794
1794
|
rvalue = function_with_rich_values('{}%{}', [self, other_],
|
|
1795
1795
|
domain=domain, is_domain_cyclic=True)
|
|
1796
1796
|
return rvalue
|
|
@@ -1839,11 +1839,13 @@ class RichValue():
|
|
|
1839
1839
|
domain=domain, is_int=is_int)
|
|
1840
1840
|
else:
|
|
1841
1841
|
other_ = other if type(other) is RichValue else RichValue(other)
|
|
1842
|
+
domain = None
|
|
1842
1843
|
if self.main != 0.:
|
|
1843
1844
|
if type(other) is not RichValue and other%2 == 0.:
|
|
1844
1845
|
domain = [0., np.inf]
|
|
1845
|
-
|
|
1846
|
-
|
|
1846
|
+
with np.errstate(over='ignore', invalid='ignore'):
|
|
1847
|
+
rvalue = function_with_rich_values(lambda a,b: a**b,
|
|
1848
|
+
[self, other_], domain=domain)
|
|
1847
1849
|
else:
|
|
1848
1850
|
rvalue = RichValue(0., domain=domain, is_int=self.is_int)
|
|
1849
1851
|
rvalue.num_sf = self.num_sf
|
|
@@ -2202,17 +2204,17 @@ class RichArray(np.ndarray):
|
|
|
2202
2204
|
return np.array([x.main for x in self.flat]).reshape(self.shape)
|
|
2203
2205
|
@property
|
|
2204
2206
|
def uncs(self):
|
|
2205
|
-
return np.array([x.unc for x in self.flat]).reshape([*self.shape,2])
|
|
2207
|
+
return np.array([x.unc for x in self.flat]).reshape([*self.shape,2])
|
|
2206
2208
|
@property
|
|
2207
2209
|
def are_lolims(self):
|
|
2208
2210
|
return np.array([x.is_lolim for x in self.flat]).reshape(self.shape)
|
|
2209
2211
|
@property
|
|
2210
2212
|
def are_uplims(self):
|
|
2211
|
-
return np.array([x.is_uplim for x in self.flat]).reshape(self.shape)
|
|
2213
|
+
return np.array([x.is_uplim for x in self.flat]).reshape(self.shape)
|
|
2212
2214
|
@property
|
|
2213
2215
|
def are_ranges(self):
|
|
2214
2216
|
return np.array([x.is_range for x in self.flat]).reshape(self.shape)
|
|
2215
|
-
@property
|
|
2217
|
+
@property
|
|
2216
2218
|
def domains(self):
|
|
2217
2219
|
return np.array([x.domain for x in self.flat]).reshape([*self.shape,2])
|
|
2218
2220
|
@property
|
|
@@ -2253,7 +2255,7 @@ class RichArray(np.ndarray):
|
|
|
2253
2255
|
return np.array([x.is_inf for x in self.flat]).reshape(self.shape)
|
|
2254
2256
|
@property
|
|
2255
2257
|
def centers(self):
|
|
2256
|
-
return np.array([x.center for x in self.flat]).reshape(self.shape)
|
|
2258
|
+
return np.array([x.center for x in self.flat]).reshape(self.shape)
|
|
2257
2259
|
@property
|
|
2258
2260
|
def rel_uncs(self):
|
|
2259
2261
|
return (np.array([x.rel_unc for x in self.flat])
|
|
@@ -2321,27 +2323,27 @@ class RichArray(np.ndarray):
|
|
|
2321
2323
|
|
|
2322
2324
|
def medians(self, num_points=None):
|
|
2323
2325
|
return np.array([x.median(num_points)
|
|
2324
|
-
for x in self.flat]).reshape(self.shape)
|
|
2326
|
+
for x in self.flat]).reshape(self.shape)
|
|
2325
2327
|
|
|
2326
2328
|
def means(self, num_points=int(1e4), sigmas=8.):
|
|
2327
2329
|
return np.array([x.mean(num_points, sigmas)
|
|
2328
|
-
for x in self.flat]).reshape(self.shape)
|
|
2330
|
+
for x in self.flat]).reshape(self.shape)
|
|
2329
2331
|
|
|
2330
2332
|
def modes(self, num_points=int(1e4), sigmas=8.):
|
|
2331
2333
|
return np.array([x.mode(num_points, sigmas)
|
|
2332
|
-
for x in self.flat]).reshape(self.shape)
|
|
2334
|
+
for x in self.flat]).reshape(self.shape)
|
|
2333
2335
|
|
|
2334
2336
|
def variances(self, num_points=int(1e4), sigmas=8.):
|
|
2335
2337
|
return np.array([x.var(num_points, sigmas)
|
|
2336
|
-
for x in self.flat]).reshape(self.shape)
|
|
2338
|
+
for x in self.flat]).reshape(self.shape)
|
|
2337
2339
|
|
|
2338
2340
|
def stds(self, num_points=int(1e4), sigmas=8.):
|
|
2339
2341
|
return np.array([x.std(num_points, sigmas)
|
|
2340
|
-
for x in self.flat]).reshape(self.shape)
|
|
2342
|
+
for x in self.flat]).reshape(self.shape)
|
|
2341
2343
|
|
|
2342
2344
|
def moments(self, n, central=True, standarized=False):
|
|
2343
2345
|
return np.array([x.moments(n, central, standarized)
|
|
2344
|
-
for x in self.flat]).reshape(self.shape)
|
|
2346
|
+
for x in self.flat]).reshape(self.shape)
|
|
2345
2347
|
|
|
2346
2348
|
def set_params(self, params):
|
|
2347
2349
|
"""Set the rich value parameters of each entry of the rich array."""
|
|
@@ -2350,7 +2352,7 @@ class RichArray(np.ndarray):
|
|
|
2350
2352
|
'minimum exponent for scientific notation': 'min_exp',
|
|
2351
2353
|
'maximum number of decimals to use parenthesis': 'max_dec',
|
|
2352
2354
|
'limit for extra significant figure': 'extra_sf_lim'}
|
|
2353
|
-
attributes = ['domain'] + list(abbreviations.values())
|
|
2355
|
+
attributes = ['domain'] + list(abbreviations.values())
|
|
2354
2356
|
for entry in abbreviations:
|
|
2355
2357
|
name = abbreviations[entry]
|
|
2356
2358
|
if entry in params:
|
|
@@ -2480,7 +2482,7 @@ class RichDataFrame(pd.DataFrame):
|
|
|
2480
2482
|
df = pd.DataFrame(data, self.index, self.columns)
|
|
2481
2483
|
return df
|
|
2482
2484
|
|
|
2483
|
-
@property
|
|
2485
|
+
@property
|
|
2484
2486
|
def mains(self): return self._property('mains')
|
|
2485
2487
|
@property
|
|
2486
2488
|
def uncs(self): return self._property2('uncs')
|
|
@@ -2982,14 +2984,14 @@ class ComplexRichValue():
|
|
|
2982
2984
|
self.imag.num_sf = x
|
|
2983
2985
|
|
|
2984
2986
|
@property
|
|
2985
|
-
def min_exp(self): return round(np.mean([self.real.min_exp, self.imag.min_exp]))
|
|
2987
|
+
def min_exp(self): return round(np.mean([self.real.min_exp, self.imag.min_exp]))
|
|
2986
2988
|
@min_exp.setter
|
|
2987
2989
|
def min_exp(self, x):
|
|
2988
2990
|
self.real.min_exp = x
|
|
2989
2991
|
self.imag.min_exp = x
|
|
2990
2992
|
|
|
2991
2993
|
@property
|
|
2992
|
-
def max_dec(self): return min(self.real.max_dec, self.imag.max_dec)
|
|
2994
|
+
def max_dec(self): return min(self.real.max_dec, self.imag.max_dec)
|
|
2993
2995
|
@max_dec.setter
|
|
2994
2996
|
def max_dec(self, x):
|
|
2995
2997
|
self.real.max_dec = x
|
|
@@ -3029,7 +3031,7 @@ class ComplexRichValue():
|
|
|
3029
3031
|
def main(self):
|
|
3030
3032
|
"""Main value."""
|
|
3031
3033
|
x = self.real.main + 1j*self.imag.main
|
|
3032
|
-
return x
|
|
3034
|
+
return x
|
|
3033
3035
|
|
|
3034
3036
|
@property
|
|
3035
3037
|
def unc(self):
|
|
@@ -3247,7 +3249,7 @@ class ComplexRichValue():
|
|
|
3247
3249
|
"""Apply a function to the rich value."""
|
|
3248
3250
|
return function_with_rich_values(function, self, **kwargs)
|
|
3249
3251
|
|
|
3250
|
-
# Instance variable acronyms.
|
|
3252
|
+
# Instance variable acronyms.
|
|
3251
3253
|
|
|
3252
3254
|
@property
|
|
3253
3255
|
def real_part(self): return self.real
|
|
@@ -3334,7 +3336,7 @@ def multiply_rich_values(x, y):
|
|
|
3334
3336
|
z = RichValue(z, dz, domain=domain, is_int=is_int)
|
|
3335
3337
|
else:
|
|
3336
3338
|
z = function_with_rich_values(lambda a,b: a*b, [x, y], domain=domain,
|
|
3337
|
-
|
|
3339
|
+
is_vectorizable=True)
|
|
3338
3340
|
z.num_sf = num_sf
|
|
3339
3341
|
z.min_exp = min_exp
|
|
3340
3342
|
z.max_dec = max_dec
|
|
@@ -3556,7 +3558,7 @@ def parse_as_rich_value(text, abbreviations={}, use_default_extra_sf_lim=False):
|
|
|
3556
3558
|
domain = read_domain(text, abbreviations)
|
|
3557
3559
|
if domain is not None:
|
|
3558
3560
|
text = text.split('[')[0][:-1]
|
|
3559
|
-
if not '--' in text:
|
|
3561
|
+
if not '--' in text:
|
|
3560
3562
|
if text.startswith('+'):
|
|
3561
3563
|
text = text[1:]
|
|
3562
3564
|
if ' e' in text:
|
|
@@ -3674,11 +3676,11 @@ def parse_as_rich_value(text, abbreviations={}, use_default_extra_sf_lim=False):
|
|
|
3674
3676
|
if mantissa <= default_extra_sf_lim:
|
|
3675
3677
|
default_num_sf = defaultparams['number of significant figures']
|
|
3676
3678
|
if num_sf < default_num_sf + 1:
|
|
3677
|
-
extra_sf_lim = mantissa
|
|
3679
|
+
extra_sf_lim = mantissa
|
|
3678
3680
|
x = x.replace('e0','')
|
|
3679
3681
|
main = _eval(x)
|
|
3680
3682
|
unc = [_eval(dx1), _eval(dx2)]
|
|
3681
|
-
is_range = False
|
|
3683
|
+
is_range = False
|
|
3682
3684
|
else:
|
|
3683
3685
|
text = text.replace(' --','--').replace('-- ','--')
|
|
3684
3686
|
text1, text2 = text.split('--')
|
|
@@ -3789,7 +3791,7 @@ def rich_value(text=None, domain=None, is_int=None, pdf=None, support=None,
|
|
|
3789
3791
|
imag = rich_value(text_imag, *args)
|
|
3790
3792
|
else:
|
|
3791
3793
|
text = text.replace(' + ', '+').replace(' - ', '-')
|
|
3792
|
-
val = complex(text)
|
|
3794
|
+
val = complex(text)
|
|
3793
3795
|
real = val.real
|
|
3794
3796
|
imag = val.imag
|
|
3795
3797
|
rvalue = ComplexRichValue(real, imag, domain, is_int)
|
|
@@ -3810,7 +3812,8 @@ def rich_value(text=None, domain=None, is_int=None, pdf=None, support=None,
|
|
|
3810
3812
|
sample = sample_from_pdf(pdf_, size=4e4, support=support)
|
|
3811
3813
|
if is_int:
|
|
3812
3814
|
sample = np.round(sample).astype(int)
|
|
3813
|
-
rvalue = evaluate_sample(sample, domain,
|
|
3815
|
+
rvalue = evaluate_sample(sample, domain=domain,
|
|
3816
|
+
consider_intervs=consider_intervs)
|
|
3814
3817
|
pdf_info['function'] = pdf_
|
|
3815
3818
|
rvalue.__dict__['pdf_info'] = pdf_info
|
|
3816
3819
|
|
|
@@ -4682,7 +4685,7 @@ def add_zero_infs(interval, zero_log, inf_log):
|
|
|
4682
4685
|
elif x2 > 0 and x2 > 10**inf_log:
|
|
4683
4686
|
x2 = np.inf
|
|
4684
4687
|
new_interval = [x1, x2]
|
|
4685
|
-
return new_interval
|
|
4688
|
+
return new_interval
|
|
4686
4689
|
|
|
4687
4690
|
def remove_zero_infs(interval, zero_log, inf_log):
|
|
4688
4691
|
"""Replace 0 and infinity for the given values in the input interval."""
|
|
@@ -4732,9 +4735,9 @@ def evaluate_domain_sample(sample):
|
|
|
4732
4735
|
domain = [float(domain1), float(domain2)]
|
|
4733
4736
|
return domain
|
|
4734
4737
|
|
|
4735
|
-
def evaluate_sample(sample,
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
+
def evaluate_sample(sample, function=None, args=None, len_samples=None,
|
|
4739
|
+
domain=None, consider_intervs=None, is_vectorizable=False,
|
|
4740
|
+
is_domain_cyclic=False, is_int=None, save_pdf=None, **kwargs):
|
|
4738
4741
|
"""
|
|
4739
4742
|
Interpret the given distribution as a rich value.
|
|
4740
4743
|
|
|
@@ -4830,8 +4833,10 @@ def evaluate_sample(sample, domain=None, function=None, args=None, is_int=None,
|
|
|
4830
4833
|
function_imag = lambda x: np.imag(function(x))
|
|
4831
4834
|
fargs = (args, is_int, len_samples, is_vectorizable, consider_intervs,
|
|
4832
4835
|
is_domain_cyclic, save_pdf)
|
|
4833
|
-
real = evaluate_sample(sample.real, domain,
|
|
4834
|
-
|
|
4836
|
+
real = evaluate_sample(sample.real, domain=domain,
|
|
4837
|
+
function=function_real, *fargs)
|
|
4838
|
+
imag = evaluate_sample(sample.imag, domain=domain,
|
|
4839
|
+
function=function_imag, *fargs)
|
|
4835
4840
|
rvalue = ComplexRichValue(real, imag)
|
|
4836
4841
|
if type(input_function) is str:
|
|
4837
4842
|
rvalue.__dict__['variables'] = variables
|
|
@@ -5080,8 +5085,8 @@ def evaluate_sample(sample, domain=None, function=None, args=None, is_int=None,
|
|
|
5080
5085
|
|
|
5081
5086
|
def function_with_rich_values(function, args, len_samples=None, domain=None,
|
|
5082
5087
|
consider_intervs=None, is_vectorizable=False,
|
|
5083
|
-
is_domain_cyclic=False,
|
|
5084
|
-
**kwargs):
|
|
5088
|
+
is_domain_cyclic=False, is_int=None,
|
|
5089
|
+
save_pdf=None, **kwargs):
|
|
5085
5090
|
"""
|
|
5086
5091
|
Apply a function to the input rich values.
|
|
5087
5092
|
|
|
@@ -5164,7 +5169,7 @@ def function_with_rich_values(function, args, len_samples=None, domain=None,
|
|
|
5164
5169
|
for k in range(output_size):
|
|
5165
5170
|
sample = [(function() if output_size == 1 else function()[k])
|
|
5166
5171
|
for i in range(len_samples)]
|
|
5167
|
-
rvalue = evaluate_sample(sample, domain)
|
|
5172
|
+
rvalue = evaluate_sample(sample, domain=domain)
|
|
5168
5173
|
output += [rvalue]
|
|
5169
5174
|
if output_size == 1 and output_type is not list:
|
|
5170
5175
|
output = output[0]
|
|
@@ -5268,9 +5273,9 @@ def function_with_rich_values(function, args, len_samples=None, domain=None,
|
|
|
5268
5273
|
if output_size > 1:
|
|
5269
5274
|
y = y[k]
|
|
5270
5275
|
return y
|
|
5271
|
-
rval_k = evaluate_sample(sample[:,k],
|
|
5272
|
-
|
|
5273
|
-
are_domains_periodic[k], save_pdf)
|
|
5276
|
+
rval_k = evaluate_sample(sample[:,k], function_k, args, len_samples,
|
|
5277
|
+
domains[k], consider_intervs, is_vectorizable,
|
|
5278
|
+
are_domains_periodic[k], is_int, save_pdf)
|
|
5274
5279
|
rval_k.num_sf = num_sf
|
|
5275
5280
|
rval_k.min_exp = min_exp
|
|
5276
5281
|
rval_k.max_dec = max_dec
|
|
@@ -5295,7 +5300,7 @@ def function_with_rich_values(function, args, len_samples=None, domain=None,
|
|
|
5295
5300
|
|
|
5296
5301
|
return output
|
|
5297
5302
|
|
|
5298
|
-
def function_with_rich_arrays(function, args, elementwise=
|
|
5303
|
+
def function_with_rich_arrays(function, args, elementwise=False, **kwargs):
|
|
5299
5304
|
"""
|
|
5300
5305
|
Apply a function to the input rich arrays.
|
|
5301
5306
|
(abbreviation: array_function)
|
|
@@ -5329,13 +5334,13 @@ def function_with_rich_arrays(function, args, elementwise=True, **kwargs):
|
|
|
5329
5334
|
domain = None
|
|
5330
5335
|
sample = distr_sample_with_rich_arrays(function, args, elementwise, **kwargs)
|
|
5331
5336
|
if len(sample.shape) == 1:
|
|
5332
|
-
output = evaluate_sample(sample,
|
|
5337
|
+
output = evaluate_sample(sample, function, args, domain=domain, **kwargs)
|
|
5333
5338
|
else:
|
|
5334
5339
|
output_size = sample.shape[1]
|
|
5335
5340
|
output = []
|
|
5336
5341
|
for k in range(output_size):
|
|
5337
5342
|
function_k = lambda *args: function(args)[k]
|
|
5338
|
-
rval_k = evaluate_sample(sample[:,k],
|
|
5343
|
+
rval_k = evaluate_sample(sample[:,k], function_k, domain=domain, **kwargs)
|
|
5339
5344
|
output += [rval_k]
|
|
5340
5345
|
if type(args) not in (tuple, list):
|
|
5341
5346
|
args = [args]
|
|
@@ -5758,7 +5763,7 @@ def curve_fit(x, y, function, guess, num_samples=3000,
|
|
|
5758
5763
|
lim1, lim2 = 0.2, 1.2
|
|
5759
5764
|
if disp_coef <= lim1:
|
|
5760
5765
|
frac1 = 1.
|
|
5761
|
-
elif disp_coef < lim2:
|
|
5766
|
+
elif disp_coef < lim2:
|
|
5762
5767
|
frac1 = 1. - disp_coef / (lim2 - lim1)
|
|
5763
5768
|
else:
|
|
5764
5769
|
frac1 = 0.
|
|
@@ -5771,7 +5776,7 @@ def curve_fit(x, y, function, guess, num_samples=3000,
|
|
|
5771
5776
|
result = {'parameters': params_fit, 'dispersion': dispersion, 'loss': loss,
|
|
5772
5777
|
'parameters samples': samples, 'dispersion sample': dispersions,
|
|
5773
5778
|
'loss sample': losses, 'number of fails': num_fails}
|
|
5774
|
-
return result
|
|
5779
|
+
return result
|
|
5775
5780
|
|
|
5776
5781
|
def point_fit(y, function, guess, num_samples=3000,
|
|
5777
5782
|
loss=lambda a,b: (a-b)**2, lim_loss_factor=4.,
|
|
@@ -5847,7 +5852,7 @@ def point_fit(y, function, guess, num_samples=3000,
|
|
|
5847
5852
|
lim1, lim2 = 0.2, 1.2
|
|
5848
5853
|
if disp_coef <= lim1:
|
|
5849
5854
|
frac1 = 1.
|
|
5850
|
-
elif disp_coef < lim2:
|
|
5855
|
+
elif disp_coef < lim2:
|
|
5851
5856
|
frac1 = 1. - disp_coef / (lim2 - lim1)
|
|
5852
5857
|
else:
|
|
5853
5858
|
frac1 = 0.
|
|
@@ -6065,4 +6070,4 @@ array_distr_sample = array_distribution_sample = distr_sample_with_rich_arrays
|
|
|
6065
6070
|
center_and_uncertainties = center_and_uncs
|
|
6066
6071
|
is_not_a_number = is_nan = isnan
|
|
6067
6072
|
is_infinite = is_inf = isinf
|
|
6068
|
-
is_finite = is_finite = isfinite
|
|
6073
|
+
is_finite = is_finite = isfinite
|
|
@@ -5,7 +5,7 @@ with open('README.md', 'r') as file:
|
|
|
5
5
|
|
|
6
6
|
setuptools.setup(
|
|
7
7
|
name = 'richvalues',
|
|
8
|
-
version = '4.2.
|
|
8
|
+
version = '4.2.25',
|
|
9
9
|
license = 'BSD-3-Clause',
|
|
10
10
|
author = 'Andrés Megías Toledano',
|
|
11
11
|
description = 'Python package for working with uncertainties and upper/lower limits',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|