Skip to content

Releases: andresmegias/richvalues

RichValues 4.2

05 Aug 09:17
c0f96bb
Compare
Choose a tag to compare

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

List of changes

  • Rich values can now be formatted inside a string. For example. if x is a rich value, one can write '{:.2f}'.format(x) or f'{x:.2f}'. In this case, the main value will be displayed. One can also write float(x) or int(x), which would return the main value converted to a float or an int, respectively.
  • There are two new optional parameters that allow for an alternative PDF representation of rich values with asymmetric uncertainties, based on split normal distributions and generative extreme value (GEV) distributions. It will only work for cases with amplitudes large enough and low or medium asymmetries, as explained in the user guide, and it will increase the computation time. The corresponding default parameters are use split normal distributions to model rich values and use generative extreme value distributions to model rich values. The motivation was to avoid bimodal distributions and obtain smoother shapes than with the default asymmetric bounded normal distributions. In any case, the original default PDFs are already fulfilling our requirements with respect to the median and the 1-σ confidence interval. This new feature was based on the following work by Antonio Possolo et al. (2019): https://iopscience.iop.org/article/10.1088/1681-7575/ab2a8d/.
  • Minor improvements and bug fixes.

RichValues 4.1

25 Jun 16:27
a1a2b2a
Compare
Choose a tag to compare

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.

RichValues 4.0

29 Jul 02:18
8e59ab5
Compare
Choose a tag to compare

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.

RichValues 3.1

24 Apr 09:27
078a377
Compare
Choose a tag to compare

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.

RichValues 3.0

10 Apr 12:08
2d47c23
Compare
Choose a tag to compare

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.

RichValues 2.0

21 Mar 19:45
af66bb8
Compare
Choose a tag to compare

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.

RichValues 1.2

23 Feb 17:05
d6fa13a
Compare
Choose a tag to compare

Release of the second minor update of the library. The user guide has been updated with the new features and modifications.

List of changes

  • Some of the arguments of the functions and classes used to create rich values have been removed. In the case of num_sf and min_exp, they can be modified changing the same-name attributes of the RichValue object. In the case of allow_log_scale, it has been removed for the sake of simplicity.
  • The main value of the RichValue class has been renamed from center to main. For the RichArray class, the method centers has been renamed to mains. However, a new method called center has been added to the RichValue class (and centers for RichArray), that returns the centers of only the rich values that have a main value with uncertainty (centered values). Also, the methods is_centr and are_centr have been added, they indicate if the corresponding rich value is a centered value.
  • The RichArray class has been improved. Now, a different domain for every entry is possible, and all of its properties should be accessed through methods. To set some of these properties with a unique value, a new method called set_params can be used.
  • The criterion for applying approximate uncertainty propagation has been improved. Related with this, some methods have been added to the RichValue and RichArray classes, mainly signal_noise and prop_factor.
  • Some minor renaming has been applied through the classes and functions of the library.
  • Added some minor improvements and bug fixes.

RichValues 1.1

09 Feb 18:16
cc767ac
Compare
Choose a tag to compare

Release of the first minor update of the library. The user guide has been updated with the new features and modifications.

List of changes

  • Added a function called errorbar for easily plotting rich values, which is basically an implementation of Matplotlib's errorbar function.
  • Added functions for fitting rich values to a model, obtaining model parameters as rich values, called point_fit and curve_fit; they are based on SciPy's minimize function, from the optimize submodule.
  • Improved function function_with_rich_values, which now supports non element-wise operations, with a variable number of outputs.
  • Added some methods for the RichValue and RichArray classes, mainly interval and is_interval for RichValue and equivalent ones for RichArray.
  • Some attributes for the RichArray class were transformed into methods to improve consistency when editing the elements of RichArray objects; these modified attributes are mainly centers, uncs, are_lolims, are_uplims and are_ranges, which are now methods.
  • Improved function evaluate_distr, which is now called inside function_with_rich_values.
  • Added shortened names / aliases for the following functions:
    • rich_value: rval.
    • rich_array: rarray.
    • rich_dataframe: rich_df.
    • function_with_rich_values: function.
    • function_with_rich_arrays: array_function.
  • Added some minor improvements and bug fixes.

RichValues 1.0

09 Nov 19:10
28ca895
Compare
Choose a tag to compare

Initial release of the library.

You can check the user guide of this version to see its features and capabilities.