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

improving the advanced indexing notebooks #264

Merged
merged 29 commits into from
Jul 3, 2024

Conversation

negin513
Copy link
Contributor

@negin513 negin513 commented Jun 6, 2024

This PR should address issue #206 .

I created and added a schematic image to explain different indexing types. I also added more examples to the notebook for more clarify.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@negin513
Copy link
Contributor Author

negin513 commented Jun 6, 2024

I am not sure why the preview of notebook is failing. There is a duplicate label warning :

 WARNING: duplicate label: indexing-1; other instance in /home/runner/work/xarray-tutorial/xarray-tutorial/fundamentals/02.1_indexing_Basic.ipynb

But I don't see any similar titles. Coud this be related to myst_parser issue?

Nevermind this was caused by duplicated exercise names.

@dcherian
Copy link
Contributor

dcherian commented Jun 6, 2024

👏🏾 👏 i love this image!

we should get it in the main docs too.

Copy link

github-actions bot commented Jun 25, 2024

♻️ PR Preview 383eeae has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

@scottyhq
Copy link
Contributor

@negin513 just a heads up - I added a couple commits to sync with the latest environment and enable the website preview link, so you can see your changes here https://xarray-contrib-xarray-tutorial-preview-pr-264.surge.sh/intermediate/indexing/advanced-indexing.html

@negin513
Copy link
Contributor Author

negin513 commented Jul 2, 2024

@dcherian and @JessicaS11 Thanks so much for your review and feedback provided. I have addressed all the comments and implemented your suggestions. Can you please take a look at this and let me know if this looks good for merging?

Thanks!
Negin

Copy link
Contributor

@scottyhq scottyhq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a wonderful improvement @negin513 thank you! I love the image and narrative flows really well. Feel free to merge. two small ideas:

  1. The plot will look better on the website if you add %config InlineBackend.figure_format='retina' in the top cell
  2. Not sure if it's worth adding a sentence or linking to np.ix_ to achieve the orthogonal result in numpy np_array[np.ix_([0, 2, 4], [0, 2, 4])] If someone knows why this is named so obscurely (.ix_) I'd love to know :)

@dcherian
Copy link
Contributor

dcherian commented Jul 2, 2024

I think meshgrid is an alternative to ix_. I won't have time to review but thanks Negin!

@negin513
Copy link
Contributor Author

negin513 commented Jul 2, 2024

Thanks @scottyhq , @dcherian , and @JessicaS11 for great comments. I have added the following:

  1. Added a dropdown note box about how to achieve numpy orthogonal indexing.
  2. added %config InlineBackend.figure_format='retina' for rendering

@scottyhq scottyhq merged commit 3d07192 into xarray-contrib:main Jul 3, 2024
3 checks passed
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.

4 participants