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

Cleanup unused code #556

Merged
merged 6 commits into from
Feb 14, 2022
Merged

Cleanup unused code #556

merged 6 commits into from
Feb 14, 2022

Conversation

jtpio
Copy link
Contributor

@jtpio jtpio commented Feb 10, 2022

Brief description of what is fixed or changed

Fixes #555

Follow-up to #547

Also tweak the "Try NumPy" title so it's centered:

image

@netlify
Copy link

netlify bot commented Feb 10, 2022

✔️ Deploy Preview for numpy-org ready!

🔨 Explore the source changes: 812928a

🔍 Inspect the deploy log: https://app.netlify.com/sites/numpy-org/deploys/6205951d62d5730007e93341

😎 Browse the preview: https://deploy-preview-556--numpy-org.netlify.app

@jtpio jtpio marked this pull request as ready for review February 10, 2022 21:43
@jarrodmillman
Copy link
Member

This looks great! One minor nit, would it be possible to add the gray background to the Try NumPy heading / text
screenshot

Just to make it clear that the Try NumPy is part of the gray box below it.

@stefanv
Copy link
Contributor

stefanv commented Feb 10, 2022

One thing I noticed: matplotlib works in these cells, but not until you've typed %matplotlib inline. Is there a way to set up the notebook so that matplotlib works out of the box?

@jtpio
Copy link
Contributor Author

jtpio commented Feb 11, 2022

This looks great! One minor nit, would it be possible to add the gray background to the Try NumPy heading / text

Done in 812928a

@jtpio
Copy link
Contributor Author

jtpio commented Feb 11, 2022

but not until you've typed %matplotlib inline. Is there a way to set up the notebook so that matplotlib works out of the box?

This seems fine when using the following code snippet?

import numpy as np
import matplotlib.pyplot as plt

x = np.linspace(0, 10, 1000)
plt.plot(x, np.sin(x));

plt.show()

image

@stefanv
Copy link
Contributor

stefanv commented Feb 11, 2022

Ah, okay: I guess no one uses plt.show in notebooks, so I didn't even think to try it.

@jobovy
Copy link

jobovy commented Feb 11, 2022

@stefanv: Once jtpio/replite#24 is merged, it would be possible to pre-run %matplotlib inline so users wouldn't have to do plt.show(). I would think that's better, although in my documentation experience, users have found it confusing when %matplotlib inline is silently assumed for code examples (lots of emails asking why plots don't show up for them from novice Python users). So another option would be to have it be part of the first import numpy as np cell (but that might lead to its own confusion...)

@stefanv
Copy link
Contributor

stefanv commented Feb 11, 2022

@jobovy Yes, explicit is probably better. We could, e.g., add a tab to the existing NumPy example snippet, so that we have multiple snippets—one of which can show how to plot.

@jtpio
Copy link
Contributor Author

jtpio commented Feb 12, 2022

e.g., add a tab to the existing NumPy example snippet

This sounds good.

At a later stage we could even consider having an (opt-in) console closer to the examples using matplotlib, for instance here: https://numpy.org/doc/stable/reference/generated/numpy.absolute.html:

image

@jarrodmillman jarrodmillman merged commit 361368e into numpy:main Feb 14, 2022
@stefanv
Copy link
Contributor

stefanv commented Feb 14, 2022

Thanks @jtpio!

@jtpio jtpio deleted the cleanup branch February 14, 2022 07:34
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.

Clean up unused code and assets
4 participants