Richvalues

Latest version: v4.2.0

Safety actively analyzes 688578 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

4.2

Minor update of RichValues, that mainly allows formatting rich values and adds optional improvements of the PDFs.

Minor updates

4.1

Minor update of RichValues 4, which adds a new way of displaying rich values, adds the function `distr_with_rich_arrays`, and improves the conversion from dataframes to LaTeX format.

List of changes
- There is a new way of representing rich values, valid both for creating a rich value and for displaying it, for centered values. It consist on writing the central value and then the uncertainty (or uncertainties) between parenthesis. It is specially suited for values with very low uncertainties. For example: `1.000436(21)`, `42103(8)`, which would be equivalent to `1.000436 +/- 0.000021` and `42103 +/- 8`, respectively.
- There is a new function, `distr_with_rich_arrays`, which is equivalent to `distr_with_rich_values`, but accepting rich arrays as an input, similarly as `function_with_rich_arrays`.
- In the method `latex()` for displaying rich dataframes in LaTeX format, there are two new arguments: `export_frame` and `export_index`.
- In the method `latex()` for displaying rich values/arrays/dataframes in LaTeX format , the argument `dollar` is now called `show_dollars`.
- The default parameter `sigmas to define upper/lower limits` is now called `sigmas to define upper/lower limits from read values`.
- Minor improvements and bug fixes.

4.0

Second major update for the library, which leads to version 4.0. Several new features have been added: rich values of integer nature, with complex numbers, and with custom probability density function (PDF). The new changes have been reflected in the new version of the user guide.

**List of changes**
- Rich values of integer nature are now supported, through the `is_int` argument of the `RichValue` class and the `rich_value` and `rich_array function`, and also the argument `are_ints` of the `RichArray` class.
- Rich values can be now created from a PDF, in the form of a function or a set of values. The information of the PDF is stored in the rich value and can be preserved when doing operations, specially with the `save_pdf` argument of the functions `evaluate_distr` and `function_with_rich_values`. In this way, this library can be used to operate just with PDFs instead of specifying central values with uncertainties, upper/lower limits or finite ranges of values.
- Complex rich values are now supported through the `ComplexRichValue` class, and can be created also with the `rich_value` function.
- Two new attributes called `is_exact` and `is_const` have been added to the `RichValue` class (and equivalently to `RichArray`, `RichDataFrame` and `RichSeries` classes).
- Functions that have a cyclic domain, like inverse trigonometric functions, can now be properly evaluated using a new argument of `evaluate_distr` and `function_with_rich_values` called `is_domain_cyclic`.
- Integer division (`//`) and module (`%`) are now supported operations for rich values.
- Some new default parameters have been added, and now there is another way of updating those values with the function `set_default_params` and to restore them with the function `restore_default_params`.
- In the functions `curve_fit` and `point_fit`, the argument `consider_intervs` has been renamed to `consider_arg_intervs`, as now there is another argument called `consider_param_intervs`.
- Several minor improvements and bug fixes have been done.

3.1

Minor update of RichValues 3, which mainly corrects several little bugs.

List of changes
- The _limit for extra significant figure_, from the default parameters, is now added as an instance variable to the `RichValue` class, `extra_sf_lim`, so that it can be changed individually for any rich value. Similarly, `RichValue`, `RichDataFrame` and `RichSeries` now have the attribute `extra_sf_lims`.
- The parsing of rich values from plain text has new capabilities. The _minimum exponent for scientific notation_ is automatically inferred now. Also, the _limit for extra significant figure_ can now be automatically inferred in case it is lower than the default value; this can be disabled to reduce the reading time a little bit with the argument `use_default_extra_sf_lim` from the functions `rich_value`, `rich_array` and `rich_dataframe`.
- Minor improvements and bug fixes.

3.0

Second major update for the library, which leads to version 3.0. Several improvements have been done, specially regarding the `RichDataFrame` class and the treatment of correlation between variables of rich values. The user guide has been updated with the new features and modifications.

**List of changes**
- Correlation between variables are now taken into account when performing operations with rich values. To do so, `RichValue` objects now store information on its dependence with independent variables. Every time a `RichValue` object is created, an arbitrary name is assigned to it, stored in the instance variables `vars` and `expression`. Then, if an operation is applied to it and a new rich value is created, the mathematical expression of this new rich value with respect to the previous ones is stored in the instance variable `expression`. Additionally, the instance variable `vars` will store the names of the independent variables involved in `expression`. In order to implement this, a new way of specifying functions to be applied to rich values has been added, and it is now the recommended way. It consists on supplying a text string describing the source code of the function, instead of directly passing the Python function; see the user guide (section 4.1.3) for more details.
- Most of the methods of the `RichValue` and `RichArray` classes that returned a property of a rich value have been converted into class attributes. This means that now they are called without using parenthesis. For example, to access to the main values of the `RichArray` object `v` now you would just write `v.mains` instead of `v.mains()`.
- The `RichDataFrame` class has been vastly improved. First of all, now `RichDataFrame` objects always preserve its class when any Pandas' `DataFrame` class method is applied (before this version, a `DataFrame` object was returned instead). Besides, all the attributes from the `RichArray` class have been implemented, which can be used to better inspect the dataframe. In order to do so, a new class called `RichSeries` have been added, which is just an implementation of Pandas' `Series` class with all the attributes from the `RichArray` class.
- Applying comparison operators (`<`, `<`, `==`, `!=`, `<=`, `>=`) between rich values is now supported. The comparisons are based on the `interval` method of the `RichValue` class. Related with this, a few functions to compare rich values/arrays have been added: `greater`, `less`, `equiv`, `greater_equiv`, `less_equiv`.
- The absolute value operator (`abs`) can now be applied to rich values.
- The functions `curve_fit` and `point_fit` now also estimate the real dispersion between the input data and the fitted model. Moreover, now they also return the final mean loss after the fit, as a rich value. Lastly, some of the names of the outputs of these functions have been renamed.
- Several minor improvements and bug fixes within different parts of the code.

2.0

First major update for the library, which leads to version 2.0. The user guide has been updated with the new features and modifications.

**List of changes**
- The mathematical function that defines the probability density function (PDF) of any rich value has been changed. Now there is only one base function, the _bounded gaussian_, which has an exact formula. Hence, no numeric relation is needed for computing the PDF. Additionally, an interpolation based on the cosine function has been implemented to make a smooth transition between the two halfs of the PDF, when having asymmetrical uncertainties and/or asymmetrical amplitudes.
- Most of the argument names, instance variables and methods regarding the creation of rich values have now aliases, which correspond to their full names.
- The code of the `round_sf_unc` function has been rewritten, simplifying the function considerably.
- The method `norm_unc` (normalized uncertainty) has been added to the `RichValue` class (and the same goes for `norm_uncs` for the `RichArray` class.
- Some minor improvements and bug fixes.

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.