Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Doc]: Commented Out Code in Downloadable Examples for Toolkits Tutorials #25582

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

Closed
Higgs32584 opened this issue Mar 30, 2023 · 9 comments · Fixed by #25594
Closed

[Doc]: Commented Out Code in Downloadable Examples for Toolkits Tutorials #25582

Higgs32584 opened this issue Mar 30, 2023 · 9 comments · Fixed by #25594
Milestone

Comments

@Higgs32584
Copy link
Contributor

Higgs32584 commented Mar 30, 2023

Documentation Link

https://matplotlib.org/stable/tutorials/toolkits/index.html

Problem

All the code is commented out in all three downloadable python examples from toolkits. When you download the files, either the .py or the .ipynb, built from each separate .py file(i.e. axes_grid.py and axes_grid.ipynb are built from the same code), all the code is commented out in each example.

Suggested improvement

It is suggested that the files referenced be rewritten as *.rst files. This would eliminate the need for download links and instead direct users to the individual gallery examples if they wish to download the code. It should be noted that the code in the files is not written in the format of a sphinx-gallery py file, but rather as python comments translated from bare rst. Therefore, none of the code is executed in sphinx-gallery or using the plot directive, and the figures are made in the examples gallery and simply linked to from the documentation. Additionally, it will be necessary to manually create the index.rst file if this solution is implemented.

@Higgs32584 Higgs32584 changed the title [Doc]: Incorrect formatting for examples in user examples for user_explain [Doc]: Commented Out Code in Downloadable Examples for Toolkits Tutorials Mar 30, 2023
@miniMaddy
Copy link

Hey @Higgs32584, I want to work on this issue. I had one doubt. Do I just uncomment the code in the files, or can I change the comments to make the code more understandable? A lot of it referencing images which is good for website but might be confusing in the actual python file.

@Higgs32584
Copy link
Contributor Author

Yeah, so I am still trying to get my first GitHub commit as well, so I do not know the codebase too well.

Right now, it looks like you have to uncomment the code on both sides, cause it is intersped with regular comments as well.

Also, it looks like a lot of the example code won't run without it's proper imports, and some initial data objects are missing, so you will have to add those as well. Finally, you'll have to load the documentation in sphinx to make sure it is framed correctly. I tried doing this today, and it looks like loading the documentation can take a bit of time.

If you are confused, you can look at another downloadable example. It looks like someone forgot to finish writing it out.

I would also wait until we get an admin to comment on this before you begin working on it.

@jklymak
Copy link
Member

jklymak commented Mar 30, 2023

This Issue will be a bit confusing given the links above. Those three files were moved, and are now served at https://matplotlib.org/devdocs/users/explain/toolkits/index.html

This code is somewhat confusing because it is not really written as a sphinx-gallery py file, but rather look to have been translated from bare rst and reformatted as python comments to be able to be run through sphinx gallery. Note that none of the code is executed in either sphinx-gallery nor using the plot directive, and that the figures are all made in the examples gallery, eg, https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_rgb.html, and simply linked here.

My suggestion would be that these get re-written as *.rst files, which will get rid of the download links. If people want the code downloads, they can click through to the individual gallery examples. If we do this, then the index.rst will need to be made by hand.

@Higgs32584
Copy link
Contributor Author

When I changed the .py files to .rst they show up like this. Where do I move the .rst files so that they render correctly?
Screenshot 2023-03-31 134324

Also, how do we rewrite the index.rst page? Thank you
Screenshot 2023-03-31 134304

@jklymak
Copy link
Member

jklymak commented Mar 31, 2023

Did you build the gallery? If not, then the figure directives will yield broken links ...

As for the index.rst it isn't great currently - I'd just add a toctree command to it (look for :toctree: in the rest of the codebase to see how to do this).

@Higgs32584
Copy link
Contributor Author

No, I have not built another index. and I would create the index.rst here, correct?

C:\Users\mjhig.vscode\bob\matplotlib\galleries\users_explain\toolkits

@jklymak
Copy link
Member

jklymak commented Mar 31, 2023

You would rename the readme there and replace it with an index.rst with the appropriate introductory sentences, and a "toctree" directive listing the three subfiles...

@ksunden ksunden linked a pull request Apr 1, 2023 that will close this issue
@Pritishchugh22
Copy link

Hi @jklymak
Hope you are doing well.
I am writing this to express my interest in participating in the Google Season of Docs program, 2023. I am a final year student at IIT Mandi, pursuing Bachelors of Technology in Computer Science. I am doing minors in Data Science and have done a significant number of courses as well as projects in this domain.
I wish if you could guide me on how I can start contributing and stand out from other participants.
Could you please guide me on how to proceed. I would appreciate any advice or recommendations you may have regarding the project.

I am attaching my resume as well as the link to my github which contains all my projects.
Resume: https://drive.google.com/file/d/1HR2JnSVzFPm4Vr76g_m2Betl8mT85jZQ/view?usp=drivesdk
Github: github.com/pritishchugh22

Thank you for your time and consideration. I hope to hear from you soon.
Thanks and regards
Pritish

@rcomer
Copy link
Member

rcomer commented Apr 9, 2023

@Pritishchugh22 please see out contributors’ guide here:
https://matplotlib.org/devdocs/devel/contributing.html

@QuLogic QuLogic added this to the v3.8.0 milestone Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants