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

docs(python): Add visualization page to user guide #13052

Merged
merged 1 commit into from
Feb 3, 2024

Conversation

braaannigan
Copy link
Collaborator

Simple page with a guide to making a chart in 4 key libraries.

The Altair plot renders on my screen with a strange actions tab on the right. I've never seen this before but haven't been able to get it back to the traditional output.

I've put this in the misc section. Perhaps we want an Integrations section that could have a page about ML, interchange protocols or similar?

@braaannigan braaannigan marked this pull request as ready for review December 21, 2023 10:13
@braaannigan
Copy link
Collaborator Author

I'm getting a doctest fail on python 3.12 because the repr of ordereddict has changed (python/cpython#101446)

I'm not sure how to work around this, do we need to ignore the check?

@braaannigan
Copy link
Collaborator Author

@MarcoGorelli I'm updating this with the .plot method

@braaannigan
Copy link
Collaborator Author

@MarcoGorelli Can you have a look at this updated page?

@MarcoGorelli
Copy link
Collaborator

yup, will take a look next week, thanks!

docs/development/contributing/index.md Outdated Show resolved Hide resolved
docs/src/python/user-guide/misc/visualization.py Outdated Show resolved Hide resolved
docs/src/python/user-guide/misc/visualization.py Outdated Show resolved Hide resolved
docs/src/python/user-guide/misc/visualization.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

Nice one!

I with corrected instructions, I was now able to build it and view the plots. Well done finding a way to keep the interactivity!

I think there's still some outstanding comments

docs/user-guide/misc/visualization.md Outdated Show resolved Hide resolved
docs/user-guide/misc/visualization.md Outdated Show resolved Hide resolved
@stinodego
Copy link
Member

stinodego commented Jan 25, 2024

Hm, this test failure is my fault as I told you to remove the dependencies in requirements-dev.txt. Let me think how to properly address this...

@braaannigan
Copy link
Collaborator Author

No idea why this is failing for 3.12 only, ideas welcome

@braaannigan
Copy link
Collaborator Author

@stinodego Finally it passes, can we go to merge??

@braaannigan
Copy link
Collaborator Author

@r-brink Should this page be moved alongside the ecosystem pages? Does the current page need to become an index page for a new section?

Copy link
Member

@stinodego stinodego left a comment

Choose a reason for hiding this comment

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

I made some minor adjustments to formatting / inserted links to the relevant plotting libraries.

Unfortunately, the interactive plots don't load for me. Only the PNGs (matplotlib / seaborn) show up. Maybe we should show all plots as PNG for now?

@braaannigan
Copy link
Collaborator Author

I made some minor adjustments to formatting / inserted links to the relevant plotting libraries.

Unfortunately, the interactive plots don't load for me. Only the PNGs (matplotlib / seaborn) show up. Maybe we should show all plots as PNG for now?

I'll have a look. Can be harder to get these html libraries to output a png sometimes

@r-brink
Copy link
Contributor

r-brink commented Jan 30, 2024

@r-brink Should this page be moved alongside the ecosystem pages? Does the current page need to become an index page for a new section?

I opened this issue to start a discussion on this topic: #13778

I think we can do two things:

  1. Add the examples on the ecosystem page. Downside is that the page can become quite long and hard to navigate
  2. As you suggest, make the ecosystem page an index page and like to subpages. Downside would be the disconnect between library and example.

We could just move your visualisation page to a subpage of ecosystem and then create a branch to experiment with putting all the examples on a single page to see what it looks like. That would be the lowest effort for now I think

@stinodego
Copy link
Member

stinodego commented Jan 30, 2024

I would propose first merging it in its current form (under misc). Just to get this PR done and merged. We can move it to a better spot later (it probably deserves more attention than it would get under 'misc').

First the plots have to render correctly though.

@stinodego stinodego changed the title Add visualisation page to user guide docs(python): Add visualisation page to user guide Jan 30, 2024
@github-actions github-actions bot added documentation Improvements or additions to documentation python Related to Python Polars labels Jan 30, 2024
@braaannigan
Copy link
Collaborator Author

I would propose first merging it in its current form (under misc). Just to get this PR done and merged. We can move it to a better spot later (it probably deserves more attention than it would get under 'misc').

First the plots have to render correctly though.
@stinodego @r-brink
Could we try merging as is to confirm if they render consistently on the web site?

I'm asking because I've never had any problems getting the plots to render so I think it should work. It also makes it tricky for me to debug

@stinodego
Copy link
Member

stinodego commented Feb 1, 2024

We cannot (and should not) use our docs website as a testing ground - it only gets deployed on new releases so you wouldn't get feedback for a while anyway.

What you can do is merge your branch on your fork and enable GitHub pages there, then you can see there if it renders correctly.

@braaannigan
Copy link
Collaborator Author

@stinodego Thanks for the gh-pages tip. Interactive plots not rendering, I'm looking into it now

@braaannigan
Copy link
Collaborator Author

@stinodego Wait, the interactive plots are working!

Just needed to refresh the page. See for yourself here:
https://braaannigan.github.io/polars/user-guide/misc/visualization/#altair

@stinodego
Copy link
Member

Yes, looks good to me too! Very nice. Did you have to make any changes or is this branch good to go with a rebase?

@braaannigan
Copy link
Collaborator Author

Yes, looks good to me too! Very nice. Did you have to make any changes or is this branch good to go with a rebase?

Couple of merge conflicts, I'm rebasing now

@braaannigan
Copy link
Collaborator Author

@stinodego Looks like we're good to go unless I've missed something

@stinodego stinodego merged commit 8c8d4fb into pola-rs:main Feb 3, 2024
13 checks passed
@stinodego stinodego changed the title docs(python): Add visualisation page to user guide docs(python): Add visualization page to user guide Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants