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

numpy --> np #45

Open
pelegs opened this issue Feb 10, 2020 · 1 comment
Open

numpy --> np #45

pelegs opened this issue Feb 10, 2020 · 1 comment

Comments

@pelegs
Copy link
Contributor

pelegs commented Feb 10, 2020

In 2.2.2. (Buffers), python code snippet:

data = numpy.zeros(4, dtype = [ ("position", np.float32, 3),
                                ("color",    np.float32, 4)] )

The first time a numpy structure is used, it is called with the name numpy (numpy.zeros), while later numpy structures are called with the abbreviation np (np.float32, specifically).

These calls should all be uniform. As the preface states that numpy is imported as import numpy as np, numpy.zeros should be changed to np.zeros.

Edit: this also repeats in 2.2.3 (Variables).

@rougier
Copy link
Owner

rougier commented Feb 10, 2020

You're right. Copy/paste error I guess. Can you make a PR?

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