-
Notifications
You must be signed in to change notification settings - Fork 56
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
add first draft of correlogram #253
Conversation
esda/correlogram.py
Outdated
attrs = [] | ||
all_attrs = list(dict(vars(autocorr)).keys()) | ||
for attribute in all_attrs: | ||
attrs.append(getattr(autocorr, str(attribute))) |
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.
I wonder if this hits any attributes that are not scalar values, and what that may do?
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.
i went through a few drafts first (despite the PRs name :P). It does grab a few, (in particular some of the attributes on the original Moran etc object are arrays, so they end up as lists in each row. not ideal). So I filter them out down in line 142 (and also drop a few constants like n
and permutations
)
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.
(there's an example of the table it generates in here)
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 you add tests, please? :)
esda/correlogram.py
Outdated
n_jobs: int = -1, | ||
backend: str = "loky", | ||
): | ||
"""Generate a spatial correlogram |
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.
Could you add a sentence explaining what a spatial correlogram is?
esda/correlogram.py
Outdated
additional keyword arguments passed to the libpysal.weights.W class | ||
stat_kwargs : dict | ||
additional keyword arguments passed to the `esda` autocorrelation statistic class. | ||
For example for faster results with no statistical inference, set the nuumber |
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.
nuumber --> number
esda/correlogram.py
Outdated
n_jobs : int | ||
number of jobs to pass to joblib. If -1 (default), all cores will be used | ||
backend : str | ||
backend parameter passed to joblb |
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.
joblb --> joblib
esda/correlogram.py
Outdated
|
||
Parameters | ||
---------- | ||
gdf : gpd.GeoDataFrame |
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.
While not critical for this PR (or code functionality itself), we should strive for proper spelling, grammar, and punctuation within our docstrings. English may not be the first language of many beginner users of the PySAL ecosystem so having clearly written documentation could likely help them get over the hump for using (and possibly contributing to) PySAL.
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.
good call
notebooks/correlogram.ipynb
Outdated
@@ -0,0 +1,893 @@ | |||
{ |
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.
Going to piggyback on Martin's comment and request a title a brief explanation be added in the notebook.
No description provided.