pysal / momepy

Urban Morphology Measuring Toolkit
https://docs.momepy.org
BSD 3-Clause "New" or "Revised" License
496 stars 59 forks source link

ENH: add neighbors #557

Closed martinfleis closed 8 months ago

martinfleis commented 8 months ago

Easy one this time. Hard to time, as cardinalities are cached.

# first run (weighted)
    # CPU times: user 49.5 ms, sys: 121 ms, total: 170 ms
    # Wall time: 179 ms
# timeit
    # 25.7 ms ± 190 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) - new
    # 549 ms ± 2.07 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) - old

Faster esp. if other function before called cardinalities.

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.6%. Comparing base (4037c70) to head (46310e8). Report is 7 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/pysal/momepy/pull/557/graphs/tree.svg?width=650&height=150&src=pr&token=VNn0WR5JWT&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pysal)](https://app.codecov.io/gh/pysal/momepy/pull/557?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pysal) ```diff @@ Coverage Diff @@ ## main #557 +/- ## ======================================= + Coverage 97.4% 97.6% +0.3% ======================================= Files 26 30 +4 Lines 4328 4818 +490 ======================================= + Hits 4214 4704 +490 Misses 114 114 ``` | [Files](https://app.codecov.io/gh/pysal/momepy/pull/557?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pysal) | Coverage Δ | | |---|---|---| | [momepy/functional/\_distribution.py](https://app.codecov.io/gh/pysal/momepy/pull/557?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pysal#diff-bW9tZXB5L2Z1bmN0aW9uYWwvX2Rpc3RyaWJ1dGlvbi5weQ==) | `100.0% <100.0%> (ø)` | | | [momepy/functional/tests/test\_distribution.py](https://app.codecov.io/gh/pysal/momepy/pull/557?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pysal#diff-bW9tZXB5L2Z1bmN0aW9uYWwvdGVzdHMvdGVzdF9kaXN0cmlidXRpb24ucHk=) | `100.0% <100.0%> (ø)` | |