-
Notifications
You must be signed in to change notification settings - Fork 58
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
Bug fixes across Lee and swap to survival function for #243 #245
Conversation
Once merged, it would be good to make a bug fix release addressing this, given the lee standardisation issue can have an impact for odd weights specifications. |
Codecov Report
@@ Coverage Diff @@
## main #245 +/- ##
=======================================
+ Coverage 71.5% 73.0% +1.5%
=======================================
Files 24 24
Lines 3246 3246
Branches 519 519
=======================================
+ Hits 2320 2369 +49
+ Misses 763 709 -54
- Partials 163 168 +5
|
test failures arise in #244, so they are unrelated to these changes. |
So the testing failures in the join counts is, I think, due to the changes upstream in |
OK, my understanding is the following. With from libpysal.weights.util import lat2W
w = lat2W(3,3)
w.neighbors # this is correct
{0: [3, 1],
3: [0, 6, 4],
1: [0, 4, 2],
4: [1, 3, 7, 5],
2: [1, 5],
5: [2, 4, 8],
6: [3, 7],
7: [4, 6, 8],
8: [5, 7]}
w.to_adjlist().head() # this is not
focal neighbor weight
0 0 3 1.0
1 0 4 1.0
2 3 0 1.0
3 3 1 1.0
4 3 2 1.0 The issue arises because, at line 440 of w.id_order
[0, 1, 2, 3, 4, 5, 6, 7, 8]
w.neighbors.keys()
dict_keys([0, 3, 1, 4, 2, 5, 6, 7, 8]) The ordering that is needed is |
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.
Code-wise looks good. If someone close to the actual stats can have a look as well, it'd be good.
Looks good! |
This addresses a few bugs filed on the Lee statistic, as well as addressing the precision concerns raised in #243 with using
1-stats.norm.cdf()
.