richvalues 4.2.22__tar.gz → 4.2.24__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.22/richvalues.egg-info → richvalues-4.2.24}/PKG-INFO +1 -1
- {richvalues-4.2.22 → richvalues-4.2.24}/pyproject.toml +1 -1
- {richvalues-4.2.22 → richvalues-4.2.24}/richvalues/__init__.py +20 -17
- {richvalues-4.2.22 → richvalues-4.2.24/richvalues.egg-info}/PKG-INFO +1 -1
- {richvalues-4.2.22 → richvalues-4.2.24}/setup.py +1 -1
- {richvalues-4.2.22 → richvalues-4.2.24}/LICENSE +0 -0
- {richvalues-4.2.22 → richvalues-4.2.24}/README.md +0 -0
- {richvalues-4.2.22 → richvalues-4.2.24}/richvalues.egg-info/SOURCES.txt +0 -0
- {richvalues-4.2.22 → richvalues-4.2.24}/richvalues.egg-info/dependency_links.txt +0 -0
- {richvalues-4.2.22 → richvalues-4.2.24}/richvalues.egg-info/requires.txt +0 -0
- {richvalues-4.2.22 → richvalues-4.2.24}/richvalues.egg-info/top_level.txt +0 -0
- {richvalues-4.2.22 → richvalues-4.2.24}/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.24"
|
|
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.24'
|
|
41
41
|
__author__ = 'Andrés Megías Toledano'
|
|
42
42
|
|
|
43
43
|
import copy
|
|
@@ -3334,7 +3334,7 @@ def multiply_rich_values(x, y):
|
|
|
3334
3334
|
z = RichValue(z, dz, domain=domain, is_int=is_int)
|
|
3335
3335
|
else:
|
|
3336
3336
|
z = function_with_rich_values(lambda a,b: a*b, [x, y], domain=domain,
|
|
3337
|
-
|
|
3337
|
+
is_vectorizable=True)
|
|
3338
3338
|
z.num_sf = num_sf
|
|
3339
3339
|
z.min_exp = min_exp
|
|
3340
3340
|
z.max_dec = max_dec
|
|
@@ -3810,7 +3810,8 @@ def rich_value(text=None, domain=None, is_int=None, pdf=None, support=None,
|
|
|
3810
3810
|
sample = sample_from_pdf(pdf_, size=4e4, support=support)
|
|
3811
3811
|
if is_int:
|
|
3812
3812
|
sample = np.round(sample).astype(int)
|
|
3813
|
-
rvalue = evaluate_sample(sample, domain,
|
|
3813
|
+
rvalue = evaluate_sample(sample, domain=domain,
|
|
3814
|
+
consider_intervs=consider_intervs)
|
|
3814
3815
|
pdf_info['function'] = pdf_
|
|
3815
3816
|
rvalue.__dict__['pdf_info'] = pdf_info
|
|
3816
3817
|
|
|
@@ -4732,9 +4733,9 @@ def evaluate_domain_sample(sample):
|
|
|
4732
4733
|
domain = [float(domain1), float(domain2)]
|
|
4733
4734
|
return domain
|
|
4734
4735
|
|
|
4735
|
-
def evaluate_sample(sample,
|
|
4736
|
-
|
|
4737
|
-
|
|
4736
|
+
def evaluate_sample(sample, function=None, args=None, len_samples=None,
|
|
4737
|
+
domain=None, consider_intervs=None, is_vectorizable=False,
|
|
4738
|
+
is_domain_cyclic=False, is_int=None, save_pdf=None, **kwargs):
|
|
4738
4739
|
"""
|
|
4739
4740
|
Interpret the given distribution as a rich value.
|
|
4740
4741
|
|
|
@@ -4830,8 +4831,10 @@ def evaluate_sample(sample, domain=None, function=None, args=None, is_int=None,
|
|
|
4830
4831
|
function_imag = lambda x: np.imag(function(x))
|
|
4831
4832
|
fargs = (args, is_int, len_samples, is_vectorizable, consider_intervs,
|
|
4832
4833
|
is_domain_cyclic, save_pdf)
|
|
4833
|
-
real = evaluate_sample(sample.real, domain,
|
|
4834
|
-
|
|
4834
|
+
real = evaluate_sample(sample.real, domain=domain,
|
|
4835
|
+
function=function_real, *fargs)
|
|
4836
|
+
imag = evaluate_sample(sample.imag, domain=domain,
|
|
4837
|
+
function=function_imag, *fargs)
|
|
4835
4838
|
rvalue = ComplexRichValue(real, imag)
|
|
4836
4839
|
if type(input_function) is str:
|
|
4837
4840
|
rvalue.__dict__['variables'] = variables
|
|
@@ -5080,8 +5083,8 @@ def evaluate_sample(sample, domain=None, function=None, args=None, is_int=None,
|
|
|
5080
5083
|
|
|
5081
5084
|
def function_with_rich_values(function, args, len_samples=None, domain=None,
|
|
5082
5085
|
consider_intervs=None, is_vectorizable=False,
|
|
5083
|
-
is_domain_cyclic=False,
|
|
5084
|
-
**kwargs):
|
|
5086
|
+
is_domain_cyclic=False, is_int=None,
|
|
5087
|
+
save_pdf=None, **kwargs):
|
|
5085
5088
|
"""
|
|
5086
5089
|
Apply a function to the input rich values.
|
|
5087
5090
|
|
|
@@ -5164,7 +5167,7 @@ def function_with_rich_values(function, args, len_samples=None, domain=None,
|
|
|
5164
5167
|
for k in range(output_size):
|
|
5165
5168
|
sample = [(function() if output_size == 1 else function()[k])
|
|
5166
5169
|
for i in range(len_samples)]
|
|
5167
|
-
rvalue = evaluate_sample(sample, domain)
|
|
5170
|
+
rvalue = evaluate_sample(sample, domain=domain)
|
|
5168
5171
|
output += [rvalue]
|
|
5169
5172
|
if output_size == 1 and output_type is not list:
|
|
5170
5173
|
output = output[0]
|
|
@@ -5268,9 +5271,9 @@ def function_with_rich_values(function, args, len_samples=None, domain=None,
|
|
|
5268
5271
|
if output_size > 1:
|
|
5269
5272
|
y = y[k]
|
|
5270
5273
|
return y
|
|
5271
|
-
rval_k = evaluate_sample(sample[:,k],
|
|
5272
|
-
|
|
5273
|
-
are_domains_periodic[k], save_pdf)
|
|
5274
|
+
rval_k = evaluate_sample(sample[:,k], function_k, args, len_samples,
|
|
5275
|
+
domains[k], consider_intervs, is_vectorizable,
|
|
5276
|
+
are_domains_periodic[k], is_int, save_pdf)
|
|
5274
5277
|
rval_k.num_sf = num_sf
|
|
5275
5278
|
rval_k.min_exp = min_exp
|
|
5276
5279
|
rval_k.max_dec = max_dec
|
|
@@ -5295,7 +5298,7 @@ def function_with_rich_values(function, args, len_samples=None, domain=None,
|
|
|
5295
5298
|
|
|
5296
5299
|
return output
|
|
5297
5300
|
|
|
5298
|
-
def function_with_rich_arrays(function, args, elementwise=
|
|
5301
|
+
def function_with_rich_arrays(function, args, elementwise=False, **kwargs):
|
|
5299
5302
|
"""
|
|
5300
5303
|
Apply a function to the input rich arrays.
|
|
5301
5304
|
(abbreviation: array_function)
|
|
@@ -5329,13 +5332,13 @@ def function_with_rich_arrays(function, args, elementwise=True, **kwargs):
|
|
|
5329
5332
|
domain = None
|
|
5330
5333
|
sample = distr_sample_with_rich_arrays(function, args, elementwise, **kwargs)
|
|
5331
5334
|
if len(sample.shape) == 1:
|
|
5332
|
-
output = evaluate_sample(sample,
|
|
5335
|
+
output = evaluate_sample(sample, function, args, domain=domain, **kwargs)
|
|
5333
5336
|
else:
|
|
5334
5337
|
output_size = sample.shape[1]
|
|
5335
5338
|
output = []
|
|
5336
5339
|
for k in range(output_size):
|
|
5337
5340
|
function_k = lambda *args: function(args)[k]
|
|
5338
|
-
rval_k = evaluate_sample(sample[:,k],
|
|
5341
|
+
rval_k = evaluate_sample(sample[:,k], function_k, domain=domain, **kwargs)
|
|
5339
5342
|
output += [rval_k]
|
|
5340
5343
|
if type(args) not in (tuple, list):
|
|
5341
5344
|
args = [args]
|
|
@@ -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.24',
|
|
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
|