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

add first draft of correlogram #253

Closed
wants to merge 0 commits into from
Closed

Conversation

knaaptime
Copy link
Member

No description provided.

@knaaptime knaaptime requested review from ljwolf and sjsrey July 20, 2023 22:50
attrs = []
all_attrs = list(dict(vars(autocorr)).keys())
for attribute in all_attrs:
attrs.append(getattr(autocorr, str(attribute)))
Copy link
Member

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?

Copy link
Member Author

@knaaptime knaaptime Jul 21, 2023

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)

Copy link
Member Author

@knaaptime knaaptime Jul 21, 2023

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)

Copy link
Member

@martinfleis martinfleis left a 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? :)

n_jobs: int = -1,
backend: str = "loky",
):
"""Generate a spatial correlogram
Copy link
Member

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/__init__.py Outdated Show resolved Hide resolved
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nuumber --> number

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

joblb --> joblib


Parameters
----------
gdf : gpd.GeoDataFrame
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call

@@ -0,0 +1,893 @@
{
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants