@Elliot-D-Hill: Unit testing power mean revealed the following bugs:
Power mean of order 0 is defined as geometric mean which equals 1 when all weights are 0. However, diversity should be 0 in that case. How and where should we fix this? Some thoughts:
Technically power mean is correct, so somehow Metacommunity should take care of this case
I wouldn't expect anyone to have a good reason to pass all-0 weights because that is not interesting, so maybe it's a matter of input validation?
When order < -100 or > 100 and all weights are 0, power_mean resorts to "initial" keyword arguments of numpy.amin and numpy.amax, which are inf and -inf, respectively. Technically, the power mean should be undefined. I suggest validating and raising exception.
All-0 weights make no sense and are non-informative. Thus, we can make this an exception case.
For the command line functionality, the input file format already excludes 0-weights, so unless an empty input file is passed, 0-weights should never happen. Will add exception when input file is empty.
@Elliot-D-Hill: Unit testing power mean revealed the following bugs:
Power mean of order 0 is defined as geometric mean which equals 1 when all weights are 0. However, diversity should be 0 in that case. How and where should we fix this? Some thoughts:
When order < -100 or > 100 and all weights are 0, power_mean resorts to "initial" keyword arguments of numpy.amin and numpy.amax, which are inf and -inf, respectively. Technically, the power mean should be undefined. I suggest validating and raising exception.
Originally posted by @JasperBraun in https://github.com/Elliot-D-Hill/metacommunity/issues/7#issuecomment-1008064776