AlejandroSantorum / scikit-rmt

Random Matrix Theory library - RMT analysis and simulation in Python
BSD 3-Clause "New" or "Revised" License
37 stars 7 forks source link

Refine `bins` argument in plotting methods and avoid over-writing it #14

Closed AlejandroSantorum closed 1 year ago

AlejandroSantorum commented 1 year ago

Currently, the methods to compute the eigenvalue histogram (eigval_hist) and to plot it (plot_eigval_hist) use an input argument called bins of type int. This follows the same style as numpy (np.histogram): https://numpy.org/doc/stable/reference/generated/numpy.histogram.html

However, the name is not informative nor clear enough. To avoid inconsistencies, I propose to rename this input argument to nbins or n_bins. Additionally, make sure inside the code the input argument bins is not over-written by the return of the numpy method np.histogram: DO NOT WRITE: observed, bins = np.histogram(...)

AlejandroSantorum commented 1 year ago

Actually, the argument bins is thought to be of type Union[int, sequence] so changing the name to n_bins is discarded. Instead, make sure it is not over-written by the return values of the numpy method np.histogram.

AlejandroSantorum commented 1 year ago

Similarly, rename the input argument bins of skrmt.ensemble.utils.plot_func to n_bins since in this case the only permitted type is int. This function does not use np.histogram, since it is not plotting a histogram but a function.