Skip to content

Variable names should generally be lowercase #65

Open

Description

@timhoffm

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.

Activity

  1. rougier commented on Jul 26, 2021

    @rougier
    Member

    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.

  2. timhoffm commented on Jul 26, 2021

    @timhoffm
    MemberAuthor

    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.

  3. rougier commented on Jul 26, 2021

    @rougier
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions