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

Fix computation of degree matrix (from normal matrix to its adjacency) #67

Merged
merged 3 commits into from
Aug 16, 2023

Conversation

smoia
Copy link
Collaborator

@smoia smoia commented Aug 15, 2023

Closes #

Fix an error for which degree matrices were computed from the original input matrix, not the adjacency matrix. This is not a problem if the input matrix and the adjacency are the same, but if by any reason they are not, the degree matrix would be wrong.

Proposed Changes

Change Type

  • bugfix (+0.0.1)
  • minor (+0.1.0)
  • major (+1.0.0)
  • refactoring (no version update)
  • test (no version update)
  • infrastructure (no version update)
  • documentation (no version update)
  • other

Checklist before review

  • I added everything I wanted to add to this PR.
  • [Code or tests only] I wrote/updated the necessary docstrings.
  • [Code or tests only] I ran and passed tests locally.
  • [Documentation only] I built the docs locally.
  • My contribution is harmonious with the rest of the code: I'm not introducing repetitions.
  • My code respects the adopted style, especially linting conventions.
  • The title of this PR is explanatory on its own, enough to be understood as part of a changelog.
  • I added or indicated the right labels.
  • I added information regarding the timeline of completion for this PR.
  • Please, comment on my PR while it's a draft and give me feedback on the development!

@smoia smoia added the BugFIX This PR generally closes a `Bug` issue, and increments the patch version (0.0.+1) label Aug 15, 2023
@smoia smoia changed the title Fix computation of degree matrix when computing the laplacian Fix computation of degree matrix (from normal matrix to its adjacency) Aug 15, 2023
@smoia smoia marked this pull request as ready for review August 15, 2023 19:15
@codecov
Copy link

codecov bot commented Aug 16, 2023

Codecov Report

Merging #67 (2f841be) into master (059532f) will increase coverage by 0.31%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #67      +/-   ##
==========================================
+ Coverage   90.61%   90.93%   +0.31%     
==========================================
  Files          14       14              
  Lines        1236     1235       -1     
==========================================
+ Hits         1120     1123       +3     
+ Misses        116      112       -4     
Files Changed Coverage Δ
nigsp/operations/laplacian.py 95.78% <100.00%> (+4.12%) ⬆️

@smoia smoia merged commit 8e4fbae into MIPLabCH:master Aug 16, 2023
@smoia
Copy link
Collaborator Author

smoia commented Aug 16, 2023

🚀 PR was released in 0.18.1 🚀

@smoia smoia added the Released This PR has been released! label Aug 16, 2023
@smoia smoia deleted the fix/degree branch August 16, 2023 11:29
@mscheltienne
Copy link
Collaborator

Have a look at assert_allclose from the numpy.testing module:
https://numpy.org/doc/stable/reference/generated/numpy.testing.assert_allclose.html

Compared to np.allclose it has a saner atol=0 and more informative message on failure. I got that tip from a trusted Scipy maintainer ;)

@smoia
Copy link
Collaborator Author

smoia commented Aug 16, 2023

Nice! Do you want to open a quick pr to change it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugFIX This PR generally closes a `Bug` issue, and increments the patch version (0.0.+1) Released This PR has been released!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants