Closed martinfleis closed 7 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 97.8%. Comparing base (
4037c70
) to head (7c04fa0
). Report is 15 commits behind head on main.
Some timings:
no mode, no quantiles
# new: 141 ms ± 626 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
# old: Wall time: 12.7 s
with mode, no quantiles
# new Wall time: 15.1 s
# old Wall time: 30.2 s
no mode, quantiles
# new Wall time: 8.54 s
# old Wall time: 14.4 s
with mode and quantiles
# new Wall time: 23.6 s
# old Wall time: 30.8 s
So we're faster in all cases. How much depends on the use case.
Merging but have numba version of the same in works. Will do follow-up.
I started refactoring
AverageCharacter
and changed my mind a couple of times on what to do about it. In the end, decided to generalise it intomomepy.describe
which computes"mean", "median", "std", "min", "max", "sum"
and optionally"mode"
of values within the neighborhood, possibly after cutting the extremes off. We still have the full functionality of the originalAverageCharacter
folded in though.I am still uncertain whether this is the right API, so I'd appreciate some input @jGaboardi and @u3ks.
Also, this may be more fitting in
libpysal.graph
but it may be wise to keep the API there a bit leaner.Tests are missing as of now but will add them tomorrow.