-
Notifications
You must be signed in to change notification settings - Fork 134
xyluo25 refactor from master: refactored utils.py and summary.py using Python 3.10, CI tests passed #145
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
Conversation
|
Hello Developers @martinfleis and @Ziqi-Li, I wanted to let you know that I have reverted the previous merges to align with the most recent commit from the main branch under pysql/mgwr. This Pull Request specifically refactors utils.py and summary.py from the main branch. Thank you for your attention to this matter. Additionally, after your validation, I will then submit new PR for merging into the main branch as well. Best, |
martinfleis
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.
This does not follow what I explained in #144 how PRs should be structured. At the same time, it brings destructive changes to both code and its functionality and our docstrings.
None of these changes is needed or agreed upon and at this point and quality only waste the maintainer time. I am sorry to be the bearer of bad news but this activity is not helping much.
| str: print out the GLM summary information | ||
| """ | ||
|
|
||
| XNames = [f"X{i}" for i in range(self.k)] |
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.
This is not equivalent of the original code. You are removing functionality here.
| for i in range(self.k): | ||
| summary += "%-31s %10.3f %10.3f %10.3f %10.3f\n" % ( | ||
| XNames[i][:30], glm_rslt.params[i], glm_rslt.bse[i], | ||
| XNames[i], glm_rslt.params[i], glm_rslt.bse[i], |
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 are you removing [:30]? That is not a stylistic change and there is a reason it is in the original code.
| str: print out the GWR summary information | ||
| """ | ||
|
|
||
| XNames = ["X" + str(i) for i in range(self.k)] |
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.
Again, this is not equivalent!
| '-' * 20, '-' * 10, '-' * 10, '-' * 10, '-' * 10, '-' * 10) | ||
| for i in range(self.k): | ||
| summary += "%-20s %10.3f %10.3f %10.3f %10.3f %10.3f\n" % ( | ||
| XNames[i][:20], np.mean(self.params[:, i]), np.std(self.params[:, i]), |
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.
Same as above.
|
|
||
| else: | ||
| XNames = ["X" + str(i) for i in range(self.k)] | ||
| XNames = ["X" + str(i) for i in range(self.k)] |
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.
Same as above
| for i in range(self.k): | ||
| summary += "%-20s %10.3f %10.3f %10.3f %10.3f %10.3f\n" % ( | ||
| XNames[i][:20], np.mean(self.params[:, i]), np.std(self.params[:, i]), | ||
| XNames[i], np.mean(self.params[:, i]), np.std(self.params[:, i]), |
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.
Same as above
| ------- | ||
| new_cmap : A new colormap that has been shifted. | ||
| ''' | ||
| def shift_colormap(cmap: LinearSegmentedColormap, |
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.
Are you sure that only LinearSegmentedColormap is allowed? not other types of Colormaps?
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.
Hi @martinfleis,
I've reviewed the existing codebase and found that LinearSegmentedColormap is the only colormap utilized in MGWR. If I've overlooked any additional colormaps currently in use, your assistance in identifying them would be greatly appreciated.
| Useful for data with a negative min and positive max | ||
| and you want the middle of the colormap's dynamic range to be at zero | ||
| Args: |
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.
This is not following numpydoc style while the original docstring does!
| additional plotting arguments for mgwr surface | ||
| savefig: string, optional | ||
| path to save the figure. Default is None. Not to save figure. | ||
| Args: |
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.
You are breaking numpydoc style again
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.
Hi Martin @martinfleis,
Thank you for your recommendation. I understand that Sphinx accepts both NumPyDoc and Google Docstring styles. Given Google Docstring's broader acceptance, I've been using it for new functions. From your comments, it seems you're advocating for consistency in existing documentation style. Acknowledging your point, I will also adhere to the NumPyDoc style to maintain this consistency.
Dear Developers @martinfleis and @Ziqi-Li ,
I'm pleased to inform you that this Pull Request has successfully refactored mgwr/utils.py and mgwr/summary.py to be compatible with Python 3.10. I intend to further update additional documents, each through separate PRs for thorough validation. Please note that the current PR has also passed all CI tests.
Best regards,
Xiangyong Roy Luo