Gracefully degrade QC plot rendering failures - #26
Conversation
Wrap the mesh/profile/hull rendering calls in qcPlots() in try/except so a rendering backend failure (e.g. kaleido 1.x requiring Chrome) logs a warning and skips that image instead of aborting a successful surface reconstruction run. Fixes Deep-MI#24
|
thanks for the contribution, looks good to me. Did you test this, e.g. you can map this file into the container and re-run? Would be great if you could do this, just to confirm we did not miss anything else. Thanks. |
|
Yes — tested this against the actual `deepmi/hipsta:0.10.1` image (`kaleido 1.3.0`, `plotly 6.8.0`) using the reproducer from #24, mounting the patched `qc_plots.py` over the installed one:
So the try/except wrapping is confirmed working as intended — a rendering failure no longer discards a successful run, and I didn't see any other regressions during a full run. Also opened #27 for the Docker Chrome install, since you mentioned being open to that as a separate stopgap — with that Dockerfile change, the same full pipeline run produces valid, non-empty QC PNGs at all three stages with no warnings, tested both as root and as a non-root `--user`. |
Summary
lpp.plot_tria_mesh(...)/fig.write_image(...)calls inqcPlots()(mesh, profile, and hull stages) in try/except, so a rendering backend failure logs a warning and skips that image instead of aborting the whole run.Ran
ruff checkandruff format --checkon the changed file per the maintainer's request.Fixes #24
Test plan
ruff check hipsta/utils/qc_plots.pypassesruff format --check hipsta/utils/qc_plots.pypasses