fix: log all figures in CustomMLFlowLogger.log_image()#499
fix: log all figures in CustomMLFlowLogger.log_image()#499Raj-Taware wants to merge 3 commits intomllam:mainfrom
Conversation
Previously only images[0] was saved and logged; all subsequent figures were silently dropped. Iterate over the full list, using a unique key per image (key_0, key_1, ...) when more than one figure is present, and wrap each iteration in the NoCredentialsError handler. Closes mllam#495 LiveReview Pre-Commit Check: skipped (iter:1, coverage:0%)
Covers single-image key preservation, multi-image indexed keys, step-based key prefixing, and NoCredentialsError exits on any iteration. LiveReview Pre-Commit Check: skipped (iter:1, coverage:0%)
|
Hi! I had opened an issue suggesting support for logging multiple images and saw this PR implementing it. Great work I’d be happy to help with testing, edge cases, or any improvements if needed |
Hey @princekumarlahon thanks ! |
|
Nice improvement overall, this definitely makes the function more flexible I had a few small observations while going through the code:
Maybe moving the logging part inside the loop would make things cleaner and ensure each image is handled consistently. Happy to take another look or help test if needed |
Hey ! Thank you for your input ! It seems like you maybe reading the old original code, the bugs you are talking about are exactly what this PR fixes. |
|
Ahh got it, thanks for pointing that out I must have been looking at the earlier version of the code. The changes make sense now I’ll go through the updated implementation more carefully and see if I can spot any edge cases or improvements. |
Describe your changes
log_image()inneural_lam/custom_loggers.pyhardcodedimages[0], silently dropping all figures after the first when a list of multiple figures was passed.imageslist{key}_0,{key}_1, …) when more than one figure is present; preserve the original key for single-figure calls (backwards compatible)NoCredentialsErrorhandler inside the loop so every iteration is coveredNo new dependencies.
Issue Link
Closes #495
Type of change
Checklist before requesting a review
pullwith--rebaseoption if possible).Checklist for reviewers
Each PR comes with its own improvements and flaws. The reviewer should check the following:
Author checklist after completed review
reflecting type of change (add section where missing):
Checklist for assignee