-
Notifications
You must be signed in to change notification settings - Fork 78
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
ENH: Graph IO to classic weights file formats #698
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #698 +/- ##
=======================================
- Coverage 85.0% 85.0% -0.0%
=======================================
Files 141 145 +4
Lines 15203 15361 +158
=======================================
+ Hits 12924 13055 +131
- Misses 2279 2306 +27
|
Can someone with a bit of historical knowledge (@serge, @levi?) help me understand the treatment of headers here? GeoDa's User Guide from 2003 states for GAL that
Our existing GAL writing uses only the number of observations in the header, but the actual IDs of observations, not the sequence number (which I translate that positional index ( With GWT, the definition is practically the same:
But our implementation does not use just the number of observations like in the GAL case but Given there is apparently no other documentation of these file formats, what are the correct headers? If we should assume that with header consisting of a number of observations only, the IDs are positional indices, than what GAL is currently doing is wrong and we should do what GWT is doing in both. Though it makes a little sense to write that we don't know something. Any clue how the header should look like for maximum compatibility? Anyone has |
Here is how spdep reads gwt files and gal files. |
This should be ready for review now. Interestingly, it has uncovered a bug in our conversion from dicts to arrays (and adjacency), where the tooling was not able to process self-weights of 1 and always considered focal == neighbor as an isolate, giving it 0. That should be fixed now. |
Also, regarding my questions above... it seems that spdep allows only integer IDs (positional) and given there is no documentation of either of those file format whatsoever, I tried to ensure that the graph IO matches the output of weights IO, so we are consistent with ourselves. |
looks fine to me! good catch on the self-weight. We need to be consistent about that, since |
WIP and not very well tested (in a sense that I am not certain it is always 1:1 with weights implementation).
So far, GAL. I am also planning to look at GWT. Is there anything else that is commonly used?