-
Notifications
You must be signed in to change notification settings - Fork 98
Fix for spatial_neighbors breaks when transform='spectral' #1028
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
base: main
Are you sure you want to change the base?
Conversation
… describe what's happening
for more information, see https://pre-commit.ci
…quidpy into fix/spectral-transform
for more information, see https://pre-commit.ci
…quidpy into fix/spectral-transform
|
thanks for the feedback but |
|
@Intron7 should I merge this branch? |
flying-sheep
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, but @Intron7 should check if it works in his example.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1028 +/- ##
==========================================
+ Coverage 23.91% 23.94% +0.02%
==========================================
Files 43 43
Lines 6368 6370 +2
Branches 1063 1064 +1
==========================================
+ Hits 1523 1525 +2
Misses 4828 4828
Partials 17 17
🚀 New features to boost your workflow:
|
src/squidpy/gr/_build.py
Outdated
| Length equals len(data). Entry-wise factors d_i * d_j * data[k] | ||
| """ | ||
|
|
||
| res = np.empty_like(data, dtype=np.float64) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why np.float64?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because original function used np.float64. Didn't want to change old behaviour
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we check if this is needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well I can't tell tbh because there was no tests for the spectral transform lol. We can just use float32 I guess. But the better way would be to ask ths users of spatial_neighbours
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Intron7 ok the results seem similar when I checked them. I also added some numerical tests to ensure stability. Also when I recalled that this was just a normalization of weights in a graph so it should not be very sensitive to precision in theory.
Fixes #1014