Skip to content

Generate the documentation images when the docs are deployed - #110

Draft
frankNiessen wants to merge 13 commits into
mainfrom
docs/generated-images
Draft

frankNiessen wants to merge 13 commits into
mainfrom
docs/generated-images

Conversation

@frankNiessen

@frankNiessen frankNiessen commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

What does this change?

  • docs/scripts/make_doc_images.m runs the ORTools plotting functions on example data without any dialogs and writes one PNG per function to docs/images:
    • martensite (MTEX): OR misfit, boundary maps, clusters, variants, packets, Bain groups, KS variant pairs, block widths, stack, habit plane (Shape method), parent twins, texture transformation (parent {111}/{200}/{220}, child {110}/{200}/{211})
    • alphaBetaTitanium (MTEX): IPDF misfit/probability
    • TRWIPsteel.ctf (repo): phases, parent-child and child-child boundaries, IPF maps (epsilon → alpha')
    • Functions that open several (docked) figures are combined: side by side (IPDF), a 2×2 grid (texture transformation) or all figures in a 5-column grid (plotStack). Every individual figure also goes to docs-review/ for choosing panels.
  • ORinfo's command window output is captured as text (docs/snippets/ORinfo.txt, included with pymdownx.snippets) instead of a screenshot.
  • deploy-docs.yml installs MATLAB R2024b (via matlab-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 change docs/scripts/, src/ or this workflow run it too, plus docs/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 the doc-images artifact and nothing is deployed from PRs.
  • Generated images are no longer tracked. Kept in 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.md explains 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 --strict passes with and without the generated files.

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
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

No deployments
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.

1 participant