Generate the documentation images when the docs are deployed - #110
Draft
frankNiessen wants to merge 13 commits into
Draft
frankNiessen wants to merge 13 commits into
frankNiessen wants to merge 13 commits into
Conversation
docs/scripts/make_doc_images.m runs the ORTools plotting functions on the MTEX example datasets and the TRWIP steel dataset without user interaction and saves one image per function to docs/images. ORinfo's command window output is captured as text instead of a screenshot. The deploy workflow installs MATLAB and MTEX 7.1.0, runs the script, then builds and deploys the site. Pull requests that change the script run it too and upload the images as an artifact. Generated images are no longer tracked; only the logos and the four GUI screenshots stay in docs/images. plotHist_ORMisfit.png was an unused duplicate, and plotPDF_bain.png, referenced but missing, is now generated.
Several ORTools functions open docked figures, which MATLAB refuses without a display. The peakFitORs image shows the interactive peak fitting window, so it stays a static screenshot like the GUI ones.
Functions that open several docked figures (plotIPDF_gB_misfit, plotIPDF_gB_prob, plotPODF_transform) now get their panels placed side by side, as in the previous hand-made images. Every figure is also saved to docs-review/ and included in the PR artifact, so the choice of panels can be reviewed.
compare_with_site.py puts each generated image next to the image of the same name on the published documentation site and writes an index.html, included in the PR artifact under docs-review/compare/.
- computehabitPlane: Shape method, which draws the fitted traces map
- plotIPDF_gB_misfit: jet colormap for the parent panel as well
- plotMap_IPF_p2c and plotMap_gB_c2c: TRWIP steel dataset
- plotStack: all figures in a grid of five columns
- plotPODF_transformation: martensite parent texture with the
{111}/{200}/{220} and {110}/{200}/{211} poles, pole figures above
ODF sections
snap now also accepts a grid of figure numbers or 'gridN'.
…changes - The parentGrainId arguments received an index into job.grains; pass the id of the largest parent grain instead - plotMap_IPF_p2c shows epsilon -> alpha' of the TRWIP steel, as the previous image did - Pull requests that change src/ also generate the images and the comparison with the published site
3 tasks done
plotStack docks 22 figures in one group; the ones that were never shown were exported as black images.
The stack mixes maps, pole figures and histograms of different sizes; fitting each into a cell of the same size gives an even grid, as in the previous image.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change?
docs/scripts/make_doc_images.mruns the ORTools plotting functions on example data without any dialogs and writes one PNG per function todocs/images:martensite(MTEX): OR misfit, boundary maps, clusters, variants, packets, Bain groups, KS variant pairs, block widths, stack, habit plane (Shapemethod), parent twins, texture transformation (parent {111}/{200}/{220}, child {110}/{200}/{211})alphaBetaTitanium(MTEX): IPDF misfit/probabilityTRWIPsteel.ctf(repo): phases, parent-child and child-child boundaries, IPF maps (epsilon → alpha')plotStack). Every individual figure also goes todocs-review/for choosing panels.ORinfo's command window output is captured as text (docs/snippets/ORinfo.txt, included withpymdownx.snippets) instead of a screenshot.deploy-docs.ymlinstalls MATLAB R2024b (viamatlab-actions, free for public repos), MTEX 7.1.0 and a virtual display (needed for docked figures), runs the script, then builds and deploys. PRs that changedocs/scripts/,src/or this workflow run it too, plusdocs/scripts/compare_with_site.py, which puts each generated image next to the published one (docs-review/compare/index.html); all of it is uploaded as thedoc-imagesartifact and nothing is deployed from PRs.docs/images: the logos and the screenshots of GUIs and interactive windows (computeGrains,guiOR,grainClick,recolorPhases,peakFitORs).plotHist_ORMisfit.png(unused duplicate) removed;plotPDF_bain.png(referenced but missing) is now generated.CONTRIBUTING.mdexplains how to generate the images locally.Why?
The images were produced by hand and drifted from the code (one was missing, one was a stale duplicate).
How was it tested?
The image workflow runs green on this PR; the published-vs-generated comparison was reviewed and the findings are addressed here (script) and in #111 (plotting functions).
mkdocs build --strictpasses with and without the generated files.