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

Improve backend documentation and get plot_forest to follow best practices #78

Merged
merged 13 commits into from
Aug 6, 2024

Conversation

OriolAbril
Copy link
Member

@OriolAbril OriolAbril commented Aug 4, 2024


📚 Documentation preview 📚: https://arviz-plots--78.org.readthedocs.build/en/78/

@OriolAbril OriolAbril marked this pull request as draft August 4, 2024 22:29
@codecov-commenter
Copy link

codecov-commenter commented Aug 5, 2024

Codecov Report

Attention: Patch coverage is 88.37209% with 10 lines in your changes missing coverage. Please review.

Project coverage is 83.58%. Comparing base (60aac9a) to head (23c9a1f).

Files Patch % Lines
src/arviz_plots/backend/bokeh/__init__.py 81.81% 2 Missing ⚠️
src/arviz_plots/backend/matplotlib/__init__.py 84.61% 2 Missing ⚠️
src/arviz_plots/backend/none/__init__.py 87.50% 2 Missing ⚠️
src/arviz_plots/backend/plotly/__init__.py 80.00% 2 Missing ⚠️
src/arviz_plots/backend/plotly/legend.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #78      +/-   ##
==========================================
- Coverage   83.84%   83.58%   -0.27%     
==========================================
  Files          20       20              
  Lines        2229     2181      -48     
==========================================
- Hits         1869     1823      -46     
+ Misses        360      358       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@OriolAbril OriolAbril marked this pull request as ready for review August 6, 2024 14:12
Comment on lines +46 to +53

Data

.. grid-item::

.. raw:: html

<s>Viz</s>
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick, this will look better vertically centered and with a larger font size

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the best way forward would be to combine everything into an image. But didn't want to get into that to prematurely. I am still not sure about the backend name for example, if we keep this DataViz idea we could rename it to "data" instead of "none".

docs/sphinxext/gallery_generator.py Show resolved Hide resolved
src/arviz_plots/backend/__init__.py Outdated Show resolved Hide resolved
src/arviz_plots/backend/__init__.py Outdated Show resolved Hide resolved
Comment on lines 134 to 135
The following examples focus on behaviour specific to ``plot_forest`` and aim to illustrate
usage of specific arguments.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The following examples focus on behaviour specific to ``plot_forest`` and aim to illustrate
usage of specific arguments.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure this intro is that useful so I suggest remove most of them and move the first sentence after the example and before the mini-gallery

Copy link
Member Author

Choose a reason for hiding this comment

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

maybe we could get rid of that completely and link to plots_intro in a See Also section (which we should add at some point, similarly to the ones in current arviz)

Copy link
Contributor

Choose a reason for hiding this comment

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

that also makes sense

Comment on lines 137 to 139
usage examples see :ref:`plots_intro`. Alternatively, to see common usage patterns
or how the plot looks for different combinations, links to all examples using
``plot_forest`` in the example gallery are shown at the bottom of the docstring.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
usage examples see :ref:`plots_intro`. Alternatively, to see common usage patterns
or how the plot looks for different combinations, links to all examples using
``plot_forest`` in the example gallery are shown at the bottom of the docstring.


Note that we are using the same :class:`~.PlotCollection`, so when using
``map`` all the same aesthetic mappings used by ``plot_forest`` are used.
.. minigallery:: plot_forest
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.. minigallery:: plot_forest
For a general introduction to batteries-included functions like this one and common
usage examples see :ref:`plots_intro`.
.. minigallery:: plot_forest

Copy link
Member Author

Choose a reason for hiding this comment

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

Left a comment above, but putting these two together might give users the idea they are related resources when they are completely different. One is quite general about functions inside arviz_plots.plots and covers the genral logic for plot_kwargs, aes_map, a bit on how to handle the returned object. Whereas the other are specific examples using the function.

IMO, people who are beginners and want to learn to use arviz-plots should go to the first resource, people who already have an idea on how to use it but are searching for a specific plot or want to see what do some of the arguments actually do should go to the 2nd

OriolAbril and others added 2 commits August 6, 2024 17:54
Co-authored-by: Osvaldo A Martin <aloctavodia@gmail.com>
@OriolAbril
Copy link
Member Author

OriolAbril commented Aug 6, 2024

Let's try this and keep iterating. It would also be nice to get feedback on the automatic figsize (currently in use for plot_forest, plot_trace and plot_trace_dist) so we have to merge and see how it goes

@OriolAbril OriolAbril merged commit 32a8702 into main Aug 6, 2024
4 checks passed
@OriolAbril OriolAbril deleted the forest_best_practice branch August 6, 2024 19:32
@OriolAbril OriolAbril mentioned this pull request Aug 29, 2024
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.

None yet

3 participants