Binbounds calculation in PowerSpace needs fixing
Currently, the initialization of a
PowerSpace has several problems:
- when specifying
logarithmic=False, the code behaves differently from the code before the
PowerSpacereorganization two months ago (this is because I'm now interpreting the parameter
logarithmic=Falseto mean "please use linear binning", instead of "please use natural binning", which was its original meaning).
- the "magic" formulae for computing nbins and binbounds are buggy; this was not really obvious before the reorganization, because they were not used in most circumstances).
- the algorithm tries to derive binbounds from insufficient user information (e.g. if the user specifies the number of bins, the code simply guesses the position of the first and last binbounds, and the guess is not necessarily intuitive).
I would strongly favor an approach where the user has to specify a set of parameters that defines the binbounds absolutely unambiguously. E.g.:
- by providing a binbounds array
- by providing a type of spacing (linear or logarithmic), a number of bins, and the first and last binbound
- by providing absolutely nothing, which leads to natural binning
There are very few cases where it could make sense for the code to guess the binbounds; the only situations that I can imagine are 1D RGSpaces and LMSpaces with linear binning. Here, there is an obvious choice for the number of bins and the placing of the binbounds.
Would it be OK if I introduced the necessary additional constraints?