Guard contrast-reserve calc for sizeless objects (stop ERROR log spam)#473
Merged
Conversation
pydeepskylog.contrast_reserve() logs logger.error(...) and returns (does not raise) when an object diameter is None, so the surrounding except (ValueError, TypeError, InvalidParameterError) cannot suppress it. object_details.update_object_info() calls it per redraw with diameter=None for objects that have a magnitude but no usable size, producing steady ERROR-level log spam (~1-2/sec on that object's detail screen) that bypasses the root=ERROR log filter. Skip the call when either diameter is None (the library cannot compute it anyway) and leave the contrast line blank -- the same end result as before (contrast was ultimately set to "" on the None return), minus the error. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Guard the contrast-reserve calculation against objects with no usable size, to stop steady ERROR-level log spam.
pydeepskylog.contrast_reserve()logslogger.error(...)and returns (it does not raise) when an object diameter isNone, so the surroundingexcept (ValueError, TypeError, InvalidParameterError)inobject_details.update_object_info()cannot suppress it. That method callscontrast_reserve()on every redraw, and for objects that have a magnitude but no usable size it passesdiameter=None— producing steady ERROR-level log spam (~1–2/sec while that object's detail screen is open) that bypasses theroot=ERRORlog filter.Fix
Skip the call when either diameter is
None(the library can't compute a contrast reserve without diameters anyway) and leave the contrast line blank. This is the same end result as before —contrastwas ultimately set to""on theNonereturn — minus the error log.Notes
Split out of #472 (IMU memory-leak fix) so it can be reviewed and merged independently; the two changes are unrelated and touch disjoint files (this one is
object_details.pyonly). Complements the Contrast Reserve documentation work in #471.🤖 Generated with Claude Code