Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REF: minor performance improvements in Graph #697

Merged
merged 2 commits into from
Apr 16, 2024

Conversation

martinfleis
Copy link
Member

Follow up on #691 and conversion to neighbors and weights dicts as discussed there.

I am also changing the sparse format to CSR which is what we need for lag and generally anything else and what weights is using. That also allows cleaner implementation of _components.

Plus using matrix_power implementation for scipy sparse array (courtesy of @ljwolf) which allows us to skip conversion to sparse matrix.

Note that the change of the sparse representation is technically a hard-breaking change but given we're in experimental phase we can afford it.

@martinfleis martinfleis added change Change of an implementation graph labels Apr 6, 2024
Copy link

codecov bot commented Apr 6, 2024

Codecov Report

Attention: Patch coverage is 96.55172% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 85.0%. Comparing base (bcabdbc) to head (438cf5f).
Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #697     +/-   ##
=======================================
- Coverage   85.0%   85.0%   -0.0%     
=======================================
  Files        141     141             
  Lines      15203   15223     +20     
=======================================
+ Hits       12924   12941     +17     
- Misses      2279    2282      +3     
Files Coverage Δ
libpysal/graph/_spatial_lag.py 100.0% <100.0%> (ø)
libpysal/graph/tests/test_base.py 100.0% <100.0%> (ø)
libpysal/graph/base.py 97.7% <96.0%> (-0.2%) ⬇️

@martinfleis martinfleis merged commit b74dc4b into pysal:main Apr 16, 2024
11 checks passed
@martinfleis martinfleis deleted the sparse-format branch April 16, 2024 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change Change of an implementation graph
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants