Demonstration using pyvista to create figures for cookbook documentation #6826
Demonstration using pyvista to create figures for cookbook documentation #6826JarettBakerDunn wants to merge 2 commits intogeodynamics:mainfrom
Conversation
|
Thanks for making the PR and for the suggestions! As I mentioned I am all for making the figures easier to reproduce and update, but this PR is meant as a discussion space, so if anyone else wants to comment please let us know what you think about it as well. To your questions, and a few thoughts I had when skimming through your PR:
I saw a few minor things in the python scripts, but before we go there we should get a general feel what others think about the change. Thanks for taking the time for this! |
|
Aside from Rene's comments I don't have any other things to suggest on the existing content of the PR, but I just want to say that I think that this is great! I've definitely run into the issue where I save a figure that I made in Paraview for a cookbook without creating a state file, which I then need to recreate in the future when I want to modify something. I'm just curious if you have thought about how to do this retroactively? Is there a good way to go through all the existing cookbooks/benchmarks and automate the creation of these pyvista figures? Or for now is this just a precedent that will be set for future cookbooks/benchmark figures? |
|
This looks great! Is there a way to automatically crop the pngs to remove unnecessary white space around the figures? If not within pyvista (though, I assume you can adjust the aspect ratio at least), we could use imagemagick ( |
|
Thanks for the feedback everyone. I think I addressed Timo and Rene's feedback in the code (But I am not sure that I correctly added the colormaps module to Daniel, glad this looks like a good idea! As far as I know there is unfortunately no way to automatically generate these pyvista scripts. Do you have any ideas about how that might work? I think that the current plan was to make some example pyvista scripts which demonstrate the techniques needed to convert any cookbook figure into a pyvista script. Once those example scripts exist then people (probably me and any others who are interested) could methodically update the older cookbooks by hand as they have time. |
This pull request is a work in progress demonstration of a new workflow for generating documentation figures using pyvista instead of paraview. It also is meant to serve as a central location to collect feedback on this idea and implementation. The idea behind creating these pyvista scripts is to make the process of updating cookbook documentation easier whenever changes to ASPECT or the cookbooks themselves cause the figures in the documentation to go out of date. The thinking is that it would be much easier to run a python script to generate a figure than to recreate a specific figure in Paraview. Also, using pyvista scripts to generate figures presents the opportunity to standardize the colormaps used in the cookbook documentation and make sure that the colormaps chosen are accessible.
The scripts in this pull request use colormaps from Fabio Crameri. The new pyvista-generated image added to the convectionBox2D benchmark is meant to demonstrate using one of Fabio Crameri’s diverging gradient colormaps to visualize temperature. The images added to the crustal deformation cookbook are meant to demonstrate using a sequential colormap to visualize viscosity. They currently use the “vik” diverging gradient colormap and the “batlow” sequential gradient colormap.
We are also looking for feedback on which colormaps to use. Are there better sequential and diverging gradient colormaps in Fabio Crameri’s scientific color maps or elsewhere?