rougier / from-python-to-numpy

An open-access book on numpy vectorization techniques, Nicolas P. Rougier, 2017
http://www.labri.fr/perso/nrougier/from-python-to-numpy
Other
2.06k stars 340 forks source link

Anatomy of an Array/Memory Layout <-- maybe make it clearer? #96

Open MikeAnblips opened 4 years ago

MikeAnblips commented 4 years ago

Hi, sorry I'm not 100% sure this is the right place to suggest that, but the following code can result a little unclear because you reference a variable index which is not previously defined:

image Then, when double-checking whether the idea works, I think you mix up variable names a little:

image

Not a big deal but I think a 'fusion' of the two snippets into one would be clearer, as direct implementation of what you propose does not work.

Best, M

rougier commented 4 years ago

Yes, this is the perfect place to report the issue. Thanks a lot and I think you're right that there's a problem. Could you make a PR to fix it?

MikeAnblips commented 4 years ago

I will... As soon as I learn how to do it properly :) Sorry for being such a noob, I'll look into it when I get a quiet 1/2h today.

rougier commented 4 years ago

No problem. Just ask me if you need some help (if this is your first pull request, it might appear a bit complex)

MikeAnblips commented 4 years ago

Thanks Nicolas, indeed I need some help. When trying to issue a new PR, I should input the reference and the modified branch, which I understand should be your base and my 'proposal', respectively. Is this understanding correct? If yes, I don't know how to create the proposal for change. I'm trying to work out what has been done for another PR I can see: image So there's a txt file which has been modified in a diagram about the location of a pointer. The txt file is a chapter of your book I surmise... Shall I do the same action? Propose a mod version of your chapter? If yes, how do I do that?

rougier commented 4 years ago

The easiest way, when the change is small is to browse the file on my repository and to "edit" it (the pen button on upper right). Since you do not have rights to modify the file, GitHub will propose you automatically to make a PR for proposing your change.

The other way is more complex but not that much:

  1. Fork the repository in you GtiHub account
  2. Clone your new forked directory on you computer
  3. cd to to you directoy and create new branch (git checkout -b "corrections" for example)
  4. Do some change to the files, add them for the next commit (git add)
  5. Do the actual commit (git commit -m "message")
  6. Push your changes (git push)

And you're mostly done. If you go on GitHub gain, you'll see your last commit and GitHub will propose you to make a PR.

If it's not clear, just tell me. I remember that I totally messed up my first PR a few years ago and someone helped me a lot)