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

Variable names should generally be lowercase #65

Open
timhoffm opened this issue Jul 25, 2021 · 3 comments
Open

Variable names should generally be lowercase #65

timhoffm opened this issue Jul 25, 2021 · 3 comments

Comments

@timhoffm
Copy link
Member

timhoffm commented Jul 25, 2021

In many places we have uppercase variables, e.g.

X = np.linspace(0, 2 * np.pi, 100)
Y = np.sin(X)

and likewise then in the plot functions.

This is against PEP-8 naming conventions and IMHO sets a bad example. At least 1D arrays should be lowercase. One may debate on 2D arrays, which have a history of using uppercase letters in the Matplotlib docs.

@rougier
Copy link
Member

rougier commented Jul 26, 2021

I use capital letters to indicate the variable is an array and I find this to be quite convenient. Since PEP-8 is a generic semantic-blind recommendation and I would prefer not to enforce it too strictly.

@timhoffm
Copy link
Member Author

I use capital letters to indicate the variable is an array

Numpy and matplotlib docs generally don't do this. Changing naming conventions (whether better or not) may be confusing.

@rougier
Copy link
Member

rougier commented Jul 26, 2021

I think PEP-8 is confusing in that specific case. But ok to change names if really necessary.

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

No branches or pull requests

2 participants