Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@xyluo25
Copy link

@xyluo25 xyluo25 commented Feb 11, 2024

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

@xyluo25
Copy link
Author

xyluo25 commented Feb 11, 2024

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,
Xiangyong Roy Luo

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.

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

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

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

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]),
Copy link
Member

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

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]),
Copy link
Member

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

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?

Copy link
Author

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

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

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

Copy link
Author

@xyluo25 xyluo25 Feb 12, 2024

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.

@xyluo25 xyluo25 closed this by deleting the head repository Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants