lmoments3.lmom_ratios was applying in-place sorting to its input (x.sort()), changed it to copy : x = np.sort(x).
Modified defaults of LmomDistrMixin.lmom_fit to avoid [].
Added an assert in lmom_ratios test.
Fixes #15 and OpenHydrology/lmoments3#2.
The issue only happens when np.asarray(x, dtype=np.float64) encounters an object it does not need to cast as an array, i.e. an array of dtype float64. In all other cases there's an implicit copy.
lmoments3.lmom_ratios
was applying in-place sorting to its input (x.sort()
), changed it to copy :x = np.sort(x)
.LmomDistrMixin.lmom_fit
to avoid[]
.lmom_ratios
test.Fixes #15 and OpenHydrology/lmoments3#2.
The issue only happens when
np.asarray(x, dtype=np.float64)
encounters an object it does not need to cast as an array, i.e. an array of dtypefloat64
. In all other cases there's an implicit copy.